Skip to main content

Volumes

Volumes are block storage devices that can be attached to instances.

Volumes are either ephemeral or persistent.

  • An ephemeral volume exists only while a compute instance exists. When the instance is deleted, the volume is deleted along with it.
  • A persistent volume survives the deletion of an instance, and can be created before the instance exists.

A volume can be created:

  • With no source, or empty.
  • From a snapshot
  • From an image

A volume created from a snapshot or image carries the source's contents (snapshot or image).

A volume can be created from the instance creation screen; from Project->Volumes->Volumes, using "Create Volume"; or from an existing volume snapshot under Project -> Volumes -> Snapshots, using Create Volume on the snapshot's row.

A volume created from a snapshot or volume image carries everything already in the snapshot or image (folders, files, and so on).

Backup through the Cloud console​

Creating a backup​

Open the NNumbers Cloud console

In the left menu, click Volumes and then volumes:

NNumbers Cloud console, Volumes: in the left menu, click Volumes and then volumes

On the volume list page, find the volume you want to back up.

tip

You can use the filter, or go by the Attached To column

Once you find the volume, click the down arrow and then Create backup

NNumbers Cloud console, Volumes: once you find the volume, click the down arrow and then Create

In the window that opens, give the backup a name and click Create Volume Backup

NNumbers Cloud console, Volumes: in the window that opens, give the backup a name and then

Restoring a backup​

To restore a backup, go to Volumes->Backups

NNumbers Cloud console, Volumes: to restore a backup, go to Volumes->Backups

In the list, select the backup to restore by clicking Restore Backup

NNumbers Cloud console, Volumes: in the list, select the backup to restore by clicking Restore Backup

In the window that opens, click Restore Backup to Volume

NNumbers Cloud console, Volumes: in the window that opens, click Restore Backup to Volume

A new volume is created with the restored data.

To confirm the restore worked as expected, go to Volumes > Volumes in the left menu

NNumbers Cloud console, Volumes: to confirm the restore worked as expected, in the left menu

Find the restored volume in the list. Then click 🔽 (item 1), and then "Launch as Instance" (item 2).

NNumbers Cloud console, Volumes: find the restored volume in the list

In the window that opens, type an instance name and click Next at the bottom

NNumbers Cloud console, Volumes: in the window that opens, type an instance name and at the bottom

Under Source

  • Change Select Boot Source to Volume
  • Find the volume in the list and click the up arrow

Then click Next at the bottom

NNumbers Cloud console, Volumes: then click Next at the bottom

Under Flavor, select the same plan the instance used before. Click 🔼 to select the plan. Then click Next at the bottom

NNumbers Cloud console, Volumes: under Flavor, select the same plan the instance used before

Under Networks, select the same network used before by clicking 🔼, then click Security Groups in the side menu

NNumbers Cloud console, Volumes: under Networks, select the same network used before by clicking 🔼, then

Under Security Groups, select the group used before by clicking 🔼. In the left menu, click Key Pair.

NNumbers Cloud console, Volumes: under Security Groups, select the group used before by clicking 🔼

Under Key Pair, select the connection key used before (or import or create a new one). Once selected, click Launch Instance at the bottom.

NNumbers Cloud console, Volumes: under Key Pair, select the connection key used before (or

Once the instance starts, you can check that everything is fine.

After checking, you can remove the old instance and use the same IP on the new one.

To do that, see the Ports walkthrough — the idea is to create a port with a fixed IP and then attach that port to the instance.

Backup through the API​

API calls can be made with curl or with any other tool, such as Postman.

This walkthrough uses Postman, with the curl call given below as well. Go to Postman and download it.

If this is your first time opening Postman, it asks you to create an account or sign in. You can skip that by clicking Skip and go to the app

NNumbers Cloud console, Volumes: if this is your first time opening Postman, a screen appears

To import the backup collection, click Import

NNumbers Cloud console, Volumes: to import the backup collection, click Import

In the window that opens, click Upload Files and select the file containing the collection.

NNumbers Cloud console, Volumes: in the window that opens, click Upload Files and select the file

On the next screen, just confirm the import into the application workspace

NNumbers Cloud console, Volumes: on the next screen, just confirm the import into the workspace

Note that the Scratch pad now holds the backup collection (expand it with the arrow next to the name)

NNumbers Cloud console, Volumes: note that the Scratch pad now holds the backup collection (expand

To create a backup through the API you need to:

Creating a backup​

To create a backup you can use Create Backup Full and Create Backup Incremental. Note that an incremental backup requires a full backup created beforehand.

Before creating the backup, we need to find the disk. Use List Volumes for that. In the URL, replace <ID_TENANT> with the project id (find it in the cloud console), then click "Headers" and edit the "X-Auth-Token" value with the value obtained in Creating an access token from application credentials or Creating an access token from user credentials. Then click Send to get the volume list.

NNumbers Cloud console, Volumes: before creating the backup, we need to find the disk

Once you find the volume, copy the ID as shown above and open one of the backup items in the scratch pad: Create Backup Full or Create Backup Incremental.

  • List volumes
Curl / Shell
curl -X GET https://cloud.nnumbers.com.br:8776/v3/$TENANT_ID/volumes/detail \
-H "X-Auth-Token: $XAUTH_TOKEN" | jq '.volumes[] | "VOL ID: \(.id) NAME: \(.name)"'

With the backup type item open, replace <ID_TENANT> in the URL with the project id (find it in the cloud console), repeat the same process to change X-Auth-Token under Headers, and edit the JSON under Body to include the volume ID and a name for the backup. Then click Send to run the backup.

NNumbers Cloud console, Volumes: with the backup type item open, replace in the URL

  • Create backup

VOL_ID=<VOLUME_ID>
BACKUP_NAME=<NAME_FOR_BACKUP>
BKP_INCREMENTAL=false # true for incremental backup | false for full backup

Curl / Shell
curl -X POST https://cloud.nnumbers.com.br:8776/v3/$TENANT_ID/backups \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $XAUTH_TOKEN" \
-d '{ "backup": { "force": true, "volume_id": "'$VOL_ID'", "name": "'$BACKUP_NAME'", "incremental": '$BKP_INCREMENTAL' } }' | jq

You can confirm the backup succeeded in two ways:

Through the NNumbers Cloud console, under Volumes -> Backup Through the API, by running List Backup

Listing backups​

To list existing backups, open List Backup in the scratch pad, replace <ID_TENANT> in the URL with the project id (find it in the cloud console), click Headers, and edit X-Auth-Token with the value obtained in Creating an access token from application credentials or Creating an access token from user credentials. Then click Send

NNumbers Cloud console, Volumes: to list existing backups, open List Backup in the scratch pad

info

If this is your first time listing backups, the values under Body differ from the image above.

  • List backups
Curl / Shell
curl -X GET https://cloud.nnumbers.com.br:8776/v3/$TENANT_ID/backups/detail \
-H "X-Auth-Token: $XAUTH_TOKEN" | jq '.backups[] | "BACKUP ID: \(.id) INCREMENTAL? \(.is_incremental) NAME: \(.name) VOL ID: \(.volume_id)"'

Deleting a backup​

To run Delete Backup you must have run the Listing backups section, found the backup to delete, and copied its ID.

With the backup ID in hand, open Delete Backup in the scratch pad, replace <ID_TENANT> in the URL with the project id (find it in the cloud console) and also the backup ID (replace {{BACKUP_ID}} at the end of the URL), click Headers, edit X-Auth-Token with the value obtained in Creating an access token from application credentials or Creating an access token from user credentials, then click Send to run it.

NNumbers Cloud console, Volumes: with the backup ID in hand, open Delete Backup in the scratch pad

NNumbers Cloud console, Volumes: with the backup ID in hand, open Delete Backup in the scratch pad

  • Delete backup

DEL_BKP_ID=<BACKUP_ID>

Curl / Shell
curl -X DELETE https://cloud.nnumbers.com.br:8776/v3/$TENANT_ID/backups/$DEL_BKP_ID \
-H "X-Auth-Token: $XAUTH_TOKEN"

Restoring a backup​

To run Restore Backup you must have run the Listing backups section, found the backup to restore, and copied its ID.

With the backup ID in hand, open Restore Backup in the scratch pad, replace <ID_TENANT> in the URL with the project id (find it in the cloud console) and also the backup ID (replace {{BACKUP_ID}} at the end of the URL), then click Headers, edit X-Auth-Token with the value obtained in Creating an access token from application credentials or Creating an access token from user credentials, give the restore a name under Body, and then click Send to run it.

NNumbers Cloud console, Volumes: with the backup ID in hand, open Restore Backup in the scratch pad

NNumbers Cloud console, Volumes: with the backup ID in hand, open Restore Backup in the scratch pad

  • Restore backup

RESTORE_BKP_ID=<BACKUP_ID>

Curl / Shell
curl -X POST https://cloud.nnumbers.com.br:8776/v3/$TENANT_ID/backups/$RESTORE_BKP_ID/restore \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $XAUTH_TOKEN" \
-d '{ "restore": { "name": "restore-01" } }' | jq

You can confirm the backup was restored successfully in two ways:

  • Through the NNumbers Cloud console, under Volumes > Volumes, finding the volume created with the name you set
  • Through the API, by running "List Volumes"

Snapshots​

A snapshot of an instance is an image. The only difference between an image you upload directly to the image service and an image you create by snapshot is that a snapshot-created image has additional properties in the image service database.

You can create a snapshot of a compute instance; that snapshot produces an image of the instance at that moment, without stopping the instance (hot), plus a volume snapshot. So the generated image is visible both under Compute -> Images and under Project -> Volumes -> Snapshot.

warning

Snapshots are not taken of ephemeral volumes (check the ephemeral disk size for the selected flavor — if it is zero, no ephemeral volume is mounted).

Groups​

Volume groups provide a mechanism for snapshotting several volumes at once, to guarantee data consistency.

A volume group can support more than one volume type, but can only contain volumes hosted by the same backend.

Creating a group​

To create a group, go to Project -> Volumes -> Groups and click Create Group at the top right.

Under group information:

  • Name: the volume group's name
  • Description: a short description of the volume group
  • Group Type: on NNumbers Cloud the only group type currently available is ssd-1.
  • Availability Zone: the availability zone where the volume group will be created.

NNumbers Cloud console, Volumes: Availability Zone: the availability zone where the volume group

Under the Manage Volume Types tab

NNumbers Cloud console, Volumes: under the Manage Volume Types tab

Select the volume type(s). On NNumbers Cloud the only volume type currently available is RBD.

NNumbers Cloud console, Volumes: select the volume type(s)

Managing volumes can be done later.

Deleting a group​

A group can only be deleted if it has no group snapshot. If it has one, the option below is not shown.

To delete a group, go to Project -> Volumes -> Groups, click 🔽 under Actions, and choose Delete Group.

NNumbers Cloud console, Volumes: to delete a group, go to Project -&gt; Volumes -&gt; Groups

Deleting a group can also delete the volumes belonging to it, if Delete Volumes is checked.

Group snapshots​

Group snapshots are logical views of snapshots created from a group.

You can create a new group from a group snapshot. Creating a group from a group snapshot clones the volumes, producing new volumes in the volume view.

Deleting a group snapshot deletes the snapshots it produced. It does not, however, delete a group and its volumes when that group was created from a group snapshot.

Next steps​