HA-NAS - Managing snapshots via API
Objective
OVHcloud HA-NAS allows you to create and manage file volumes that can be accessed over a network.
This guide explains how to manage the snapshots of a HA-NAS partition via the OVHcloud API.
Requirements
- An OVHcloud HA-NAS service
- Consulting the OVHcloud API first steps guide to familiarise yourself with the OVHcloud APIv6
Instructions
Please visit the HA-NAS FAQ page for detailed information on the snapshot function.
All API routes in this guide are available in the section /dedicated/nasha: https://api.ovh.com/console/#/dedicated/nasha.
When using the API, all fields marked with an asterisk (*) are required.
Retrieving information about your service
All your active services can be retrieved by using the following route:
By default, a snapshot of your data takes place every hour and is saved on your HA-NAS. You can activate additional snapshot policies which will create snapshots at preset frequencies.
Retrieving the automatic snapshot schedule
To view the active automatic snapshot schedule, use the following route:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
Adding an automatic snapshot interval
To create additional automatic snapshots at a selected frequency, use the following route:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
snapshotType | Yes | A frequency for the snapshot: day-1, day-2, day-3, day-7, hour-1, or hour-6 |
Retrieving information about automatic snapshots
To retrieve the details of an automatic snapshot, use the following route:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
snapshotType | Yes | The snapshot frequency concerned: day-1, day-2, day-3, day-7, hour-1, or hour-6 |
Removing an automatic snapshot interval
Use the following route to delete an automatic snapshot frequency:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
snapshotType | Yes | The snapshot frequency concerned: day-1, day-2, day-3, day-7, hour-1, or hour-6 |
You can also utilise instant snapshots with your HA-NAS (custom snapshots) via the following endpoints.
Listing custom snapshots
Use the following route to retrieve existing custom snapshots:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
Creating a custom snapshot
To add a manual snapshot, use the following route:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
expiration | An optional expiration date, for example: 2022-06-24 (ISO 8601) | |
name | Yes | A name for the snapshot |
Retrieving information about a custom snapshot
To view the details of a custom snapshot, use the following route:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
name | Yes | The name of the snapshot |
Removing a custom snapshot
Use the following route to delete a custom snapshot:
| Parameter | Required | Description |
|---|---|---|
serviceName | Yes | The internal name of your HA-NAS service |
partitionName | Yes | Name of the partition |
name | Yes | The name of the snapshot |
Restoring snapshots
The API functions do not include accessing and restoring your snapshots. They are stored as read-only on the partition.
To access snapshots from your mount point, you need to navigate to the directory .zfs/snapshot of your partition.
For example, on your service with the ID zpool-123456, a partition named partition1 exists of which you have created a snapshot named snap-snapshot01. You can find the snapshot with this command:
To restore your snapshot, copy it from the .zfs file path to the new directory where you want to restore the snapshot. You can use a tool like "rsync" that allows you to perform restores.
You can find more information in the Go further section of this guide.
Go further
Mount your NAS on Windows Server via CIFS
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
Join our community of users on https://community.ovh.com/en/.