Back up a snapshot

You can create a full backup from a snapshot by using the ID of the volume associated with the snapshot.

Before you begin

  • Your backup repository must have the necessary space.
  • The backup quotas specified for your project have not been exceeded.

About this task

The backup is created by directly attaching to the snapshot, which is faster than cloning the snapshot into a volume and then backing up this volume. But this feature can affect the backup performance because of the extra step of creating the volume from a snapshot.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. List the snapshots to obtain the name or ID of the snapshot you want to backup:
    $ openstack volume snapshot list
  3. List the details of this snapshot to obtain the ID of the volume associated with this snapshot:
    $ openstack volume snapshot show <snapshot>
    • Replace <snapshot> with the name or ID of the snapshot you want to backup.

      The value of the volume_id field is the ID of the volume associated with this snapshot. For example:

      $ openstack volume snapshot show snap_1
      +--------------------------------------------+--------------------------------------+
      | Field                                      | Value                                |
      +--------------------------------------------+--------------------------------------+
      | created_at                                 | 2023-07-18T08:14:16.000000           |
      | description                                | None                                 |
      | id                                         | 2d95b707-6657-49af-ac8f-f9a7417d4650 |
      | name                                       | snap_1                               |
      | os-extended-snapshot-attributes:progress   | 100%                                 |
      | os-extended-snapshot-attributes:project_id | c2c1da89ed1648fc8b4f35a045f8d34c     |
      | properties                                 |                                      |
      | size                                       | 1                                    |
      | status                                     | available                            |
      | updated_at                                 | 2023-07-18T08:14:17.000000           |
      | volume_id                                  | 6841e3d1-8a1a-4496-bc51-f7c04b787e8f |
      +--------------------------------------------+--------------------------------------+
  4. Backup the snapshot:
    $ openstack volume backup create [--name <backup_name>] --snapshot <snapshot> <volume_id>
    • Replace <volume_id> with the ID of the volume associated with this snapshot.
    • Optional: Replace <backup_name> with the name of this backup.

      This command immediately provides the ID of this backup but the snapshot is backed up asynchronously, in the background. For example:

      $ openstack volume backup create --name snap1bu1 --snapshot snap_1 6841e3d1-8a1a-4496-bc51-f7c04b787e8f
      +-------+--------------------------------------+
      | Field | Value                                |
      +-------+--------------------------------------+
      | id    | 867e6cfb-9be7-47fa-8a79-221b0e80c757 |
      | name  | snap1bu1                             |
      +-------+--------------------------------------+

Results

  • List the backups:
    $ openstack volume backup list

    The snapshot backup is created when this backup has an available status. For example:

    +--------------------------------------+------------+-------------+-----------+------+
    | ID                                   | Name       | Description | Status    | Size |
    +--------------------------------------+------------+-------------+-----------+------+
    | 867e6cfb-9be7-47fa-8a79-221b0e80c757 | snap1bu1    | None        | available |    1 |
    +--------------------------------------+------------+-------------+-----------+------+
    1. Exit the openstackclient pod:
      $ exit