Managing Snapshots

Snapshots capture the state of a volume and store the difference between the changing data on the virtual machine volume and the state of a volume at a particular point in time (when the snapshot is created). This allows you to copy volumes to clone a virtual machine, change the volume type, or create a backup. Snapshots are not the most viable solution for backing up applications, because the data is saved on the same equipment as the volume.

Creating Snapshots

Creating Snapshots in the Control panel

To create a snapshot of a volume in the Control panel:

  1. Go to the Volumes tab in the project.
  2. Expand the (⋮) menu of the volume’s card and click Make snapshot.
  3. You can also open the volume’s card and click Create snapshot in the Snapshots section.

The snapshot name is set automatically in the snap-creation date_creation time form, for example, snap-14.05.20_14.43.

Creating Snapshots through Console Clients

Read more about getting started through console clients in the article.

Run the following command to create a snapshot through console clients:

openstack volume snapshot create --volume <volume ID> <snapshot name>

A large number of snapshots slows down the performance of the volume. You can create only one snapshot — the snapshots_per_volume quota is set to 1. If you try to create more than one snapshot, you will get an error message:

SnapshotPerVolumeLimitExceeded: Maximum number of snapshots allowed per volume 08ed209f-5e7f-465c-b1e1-221b850298db (1) exceeded.
Quota: snapshots_per_volume_fast.ru-2b (HTTP 413)

Viewing Snapshots

Viewing Snapshots in the Control panel

To view a snapshot:

  1. Go to the Volumes tab in the project.
  2. Open the volume’s card and go to the Snapshots tab.

A list of existing snapshots, their names, and creation dates will be displayed.

Viewing Snapshots through Console Clients

Run the following command to view a snapshot of a specific volume:

openstack volume snapshot list --volume <volume>

To view a list of all snapshots:

openstack volume snapshot list

The response will look as follows:

+--------------------------------------+---------------------+-------------+-----------+------+
| ID                                   | Name                | Description | Status    | Size |
+--------------------------------------+---------------------+-------------+-----------+------+
| cb74e550-fa96-4a9c-b685-ecb078966339 | test_snapshot       | None        | available |    5 |
| 39dc0cb2-6818-4b12-88fc-b2d139335a75 | snap-26.03.20_13.22 | None        | available |   25 |
+--------------------------------------+---------------------+-------------+-----------+------+

To filter the list of all snapshots:

openstack volume snapshot list --long -c <ID> -c <Name> -c <Status> -c <Size> -c <Volume>

The response will look as follows:

+--------------------------------------+---------------------+-----------+------+----------------------------+
| ID                                   | Name                | Status    | Size | Volume                     |
+--------------------------------------+---------------------+-----------+------+----------------------------+
| cb74e550-fa96-4a9c-b685-ecb078966339 | test_snapshot       | available |    5 | VOLUME_NAME                |
| 39dc0cb2-6818-4b12-88fc-b2d139335a75 | snap-26.03.20_13.22 | available |   25 | disk-for-Latoya-#1         |
+--------------------------------------+---------------------+-----------+------+----------------------------+

Run the following command to view snapshot information:

openstack volume snapshot show <snapshot>

The response will look as follows:

+--------------------------------------------+--------------------------------------+
| Field                                      | Value                                |
+--------------------------------------------+--------------------------------------+
| created_at                                 | 2020-04-28T01:22:04.000000           |
| description                                | None                                 |
| id                                         | cb74e550-fa96-4a9c-b685-ecb078966339 |
| name                                       | test_snapshot                        |
| os-extended-snapshot-attributes:progress   | 100%                                 |
| os-extended-snapshot-attributes:project_id | 04d92ef9fe254caaa90d6ecd2849c1cf     |
| properties                                 |                                      |
| size                                       | 5                                    |
| status                                     | available                            |
| updated_at                                 | 2020-04-28T01:22:05.000000           |
| volume_id                                  | 08ed209f-5e7f-465c-b1e1-221b850298db |
+--------------------------------------------+--------------------------------------+

Configuring Snapshots

You can only change the snapshot name.

Configuring Snapshots in the Control panel

To change the snapshot name in the Control panel:

  1. Go to the Volumes tab in the project.
  2. Open the volume’s card and go to the Snapshots tab.
  3. Enter a new name in the Name field.

Configuring Snapshots through Console Clients

Run the following command to change the snapshot name:

openstack volume snapshot set --description <new name> <snapshot>

Creating Volumes from Snapshots

Creating Volumes from Snapshots in the Control panel

To create a volume from a snapshot in the Control panel:

  1. Go to the Volumes tab in the project.
  2. Open the volume’s card and go to the Snapshots tab.
  3. Expand the context (⋮) menu and click Create volume from this snapshot.
  4. Fill in all the fields and click Create in the new window.

The new volume will appear in the list of the project’s volumes.

Creating Volumes from Snapshots through Console Clients

The volume can be fast, basic, universal, or iso. Enter the volume <type> in the format **<Volume Type>.<Zone Name>**, for example, fast.ru-2a.

To view the type of the volume in use, run the command openstack volume type list.

Run the following command to create a volume from a snapshot:

openstack volume create --snapshot <snapshot> --type <type> <volume>

Deleting Snapshots

A large number of snapshots slows down the performance of the volume. We recommend deleting the snapshot after performing all operations with it. For long-term storage of the volume state, create a volume from a snapshot.

Deleting Snapshots in the Control panel

To delete a snapshot in the Control panel:

  1. Go to the Volumes tab in the project.
  2. Open the volume’s card and go to the Snapshots tab.
  3. Expand the context (⋮) menu and click Delete.

Snapshots associated with the volume can be deleted if Delete snapshots of this volume option is selected when deleting a volume. Deleting a volume is not available without preliminary deleting the snapshots.

*Please note that when deleting a cloud server, selecting the Delete volumes of this server option will delete the server’s volumes and their snapshots.*

Deleting Snapshots through Console Clients

After you finish working with a snapshot, you need to delete it so that you can create a new one, and also because snapshots slow down the performance of the volume.

Run the following command to delete a snapshot:

openstack volume snapshot delete <snapshot>

Cloning Servers

To quickly clone a server:

  1. Create a new snapshot of a server (or you can choose an existing copy).
  2. When creating a server, under Source, open the Snapshots tab.
  3. Choose the desired snapshot and create your server.