3.15. Managing volume snapshots¶
3.15.1. vinfra service compute volume snapshot create¶
Create a snapshot of a volume:
usage: vinfra service compute volume snapshot create [--description <description>]
                                                     --volume <volume>
                                                     <volume-snapshot-name>
--description <description>- Volume snapshot description
 --volume <volume>- Volume ID or name
 <volume-snapshot-name>- Volume snapshot name
 
Example:
# vinfra service compute volume snapshot create mysnapshot --volume myvolume
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2019-04-30T13:12:54.297629+00:00     |
| description |                                      |
| id          | 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 |
| metadata    | {}                                   |
| name        | mysnapshot                           |
| project_id  | fd0ae61496d04ef6bb637bc3167b7eaf     |
| size        | 8                                    |
| status      | creating                             |
| volume_id   | 92dc3bd7-713d-42bf-83cd-4de40c24fed9 |
+-------------+--------------------------------------+
This command initiates creation of a snapshot mysnapshot of the volume myvolume.
3.15.2. vinfra service compute volume snapshot list¶
List volume snapshots:
usage: vinfra service compute volume snapshot list [--long] [--volume <volume>]
--long- Enable access and listing of all fields of objects.
 --volume <volume>- Volume ID or name
 
Example:
# vinfra service compute volume snapshot list -c id -c name -c size -c status
+--------------------------------------+------------+-----------+
| id                                   | name       | status    |
+--------------------------------------+------------+-----------+
| 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 | mysnapshot | available |
+--------------------------------------+------------+-----------+
This command lists volume snapshots available to the compute cluster. (The output is abridged to fit on page.)
3.15.3. vinfra service compute volume snapshot show¶
Display details of a volume snapshot:
usage: vinfra service compute volume snapshot show <volume-snapshot>
<volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot show mysnapshot
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2019-04-30T13:12:54.297629+00:00     |
| description |                                      |
| id          | 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 |
| metadata    | {}                                   |
| name        | mysnapshot                           |
| project_id  | fd0ae61496d04ef6bb637bc3167b7eaf     |
| size        | 8                                    |
| status      | available                            |
| volume_id   | 92dc3bd7-713d-42bf-83cd-4de40c24fed9 |
+-------------+--------------------------------------+
This command shows the details for the volume snapshot mysnapshot.
3.15.4. vinfra service compute volume snapshot set¶
Modify volume snapshot parameters:
usage: vinfra service compute volume snapshot set [--description <description>]
                                                  [--name <name>] <volume-snapshot>
--description <description>- Volume snapshot description
 --name <name>- A new name for the volume snapshot
 <volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot set mysnapshot --name mynewsnapshot
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2019-04-30T13:12:54.297629+00:00     |
| description |                                      |
| id          | 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 |
| metadata    | {}                                   |
| name        | mynewsnapshot                        |
| project_id  | fd0ae61496d04ef6bb637bc3167b7eaf     |
| size        | 8                                    |
| status      | available                            |
| volume_id   | 92dc3bd7-713d-42bf-83cd-4de40c24fed9 |
+-------------+--------------------------------------+
This command changes the name of the volume snapshot mysnapshot to mynewsnapshot.
3.15.5. vinfra service compute volume snapshot upload-to-image¶
Create a compute image from a compute volume snapshot:
usage: vinfra service compute volume snapshot upload-to-image [--name <name>]
                                                              <volume-snapshot>
--name <name>- Image name
 <volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot upload-to-image --name myvm-image \
mynewsnapshot
+------------------+--------------------------------------+
| Field            | Value                                |
+------------------+--------------------------------------+
| checksum         |                                      |
| container_format | bare                                 |
| created_at       |                                      |
| disk_format      | qcow2                                |
| id               | 6a7a78c1-7168-4387-9b55-23fd477fdaa0 |
| min_disk         |                                      |
| min_ram          |                                      |
| name             | myvm-image                           |
| os_distro        | linux                                |
| os_type          | linux                                |
| project_id       |                                      |
| protected        | False                                |
| public           | False                                |
| size             | 1                                    |
| status           | uploading                            |
| tags             |                                      |
| updated_at       | 2019-06-07T12:30:43.462707           |
| virtual_size     |                                      |
+------------------+--------------------------------------+
This command creates the compute image myvm-image from the volume snapshot mynewsnapshot.
3.15.6. vinfra service compute volume snapshot revert¶
Revert a volume to the specified snapshot:
usage: vinfra service compute volume snapshot revert <volume-snapshot>
<volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot revert mynewsnapshot
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2019-04-30T13:12:54.297629+00:00     |
| description |                                      |
| id          | 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 |
| metadata    | {}                                   |
| name        | mynewsnapshot                        |
| project_id  | fd0ae61496d04ef6bb637bc3167b7eaf     |
| size        | 8                                    |
| status      | available                            |
| volume_id   | 92dc3bd7-713d-42bf-83cd-4de40c24fed9 |
+-------------+--------------------------------------+
This command reverts the volume to its snapshot mynewsnapshot.
3.15.7. vinfra service compute volume snapshot reset-state¶
Reset a volume snapshot stuck in the “Error” state or one of transitional states to the “Available” state:
usage: vinfra service compute volume snapshot reset-state <volume-snapshot>
<volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot reset-state mynewsnapshot
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2019-04-30T13:12:54.297629+00:00     |
| description |                                      |
| id          | 3fdfe5d6-8bd2-4bf5-8599-a9cef50e5b71 |
| metadata    | {}                                   |
| name        | mynewsnapshot                        |
| project_id  | fd0ae61496d04ef6bb637bc3167b7eaf     |
| size        | 8                                    |
| status      | available                            |
| volume_id   | 92dc3bd7-713d-42bf-83cd-4de40c24fed9 |
+-------------+--------------------------------------+
This command resets the state of the volume snapshot mynewsnapshot.
3.15.8. vinfra service compute volume snapshot delete¶
Delete a volume snapshot:
usage: vinfra service compute volume snapshot delete <volume-snapshot>
<volume-snapshot>- Volume snapshot ID or name
 
Example:
# vinfra service compute volume snapshot delete mynewsnapshot
Operation successful
This command deletes the volume snapshot mynewsnapshot.