Restore volume backups

Restore Block Storage volume backups to a specific existing volume or to a new volume. Only administrators can cancel a restore operation.

Restore a backup to a specific volume

You can restore a volume backup to an available volume that you have already created.

About this task

If you restore a volume from an encrypted volume backup, then the destination volume type must also be encrypted.

Important
If you choose Red Hat Ceph Storage as the back end for your backup repository, then you can only restore backed up volumes to a RBD-based Block Storage back end.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. List the backups to obtain the name or ID of the backup you want to restore:
    $ openstack volume backup list

    For example:

    +--------------------------------------+---------+-------------+-----------+------+
    | ID                                   | Name    | Description | Status    | Size |
    +--------------------------------------+---------+-------------+-----------+------+
    | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None        | available |    1 |
  3. List the volumes:
    $ openstack volume list

    Ensure that the status of the required volume is available and then obtain the name or ID of this volume. For example:

    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | ID                                   | Name           | Status    | Size | Attached to                    |
    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | 654e2be8-bc79-4528-96a7-5f773d31c201 | vol_3          | available |    1 |                                |
  4. Restore the backup to the volume:
    $ openstack volume backup restore <backup> <volume>
    • Replace <backup> with the name or ID of the Block Storage volume backup.
    • Replace <volume> with the name or ID of the available Block Storage volume.

      For example:

      $ openstack volume backup restore vol1bu2 vol_3
      +-------------+--------------------------------------+
      | Field       | Value                                |
      +-------------+--------------------------------------+
      | backup_id   | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb |
      | volume_id   | 654e2be8-bc79-4528-96a7-5f773d31c201 |
      | volume_name | vol_3                                |
      +-------------+--------------------------------------+
  5. Verify that the backup_id provided by this command corresponds to the ID of the backup that was restored and that the volume_name and volume_id values correspond to the name and ID of the specified volume.
  6. Delete the backup if you no longer need it:
    $ openstack volume backup delete <backup>
  7. Exit the openstackclient pod:
    $ exit

Restore a backup to a new volume

You can create a new volume when you restore a backup of a Block Storage volume.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. List the backups to obtain the name or ID of the backup you want to restore:
    $ openstack volume backup list

    For example:

    +--------------------------------------+---------+-------------+-----------+------+
    | ID                                   | Name    | Description | Status    | Size |
    +--------------------------------------+---------+-------------+-----------+------+
    | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None        | available |    1 |
  3. Restore the backup to a new volume:
    $ openstack volume backup restore <backup> [<volume>]
    • Replace <backup> with the ID of the Block Storage volume backup.
    • Optional: Replace <volume> with the ID of the Block Storage volume.
  4. Verify that the backup_id provided by this command corresponds to the ID of the backup that was restored.

    The volume_id value is the ID of the created volume. But the volume_name can be a temporary name that is replaced with the name of the backed up volume.

  5. List the volumes to verify that the volume with an ID of volume_id has been created and to obtain this volume name:
    $ openstack volume list

    For example:

    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | ID                                   | Name           | Status    | Size | Attached to                    |
    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | 296c853c-c749-4eb6-857a-57ec182232a6 | vol_1          | available |    1 |                                |
  6. Delete the backup if you no longer need it:
    $ openstack volume backup delete <backup>
  7. Exit the openstackclient pod:
    $ exit

Cancel a restore

You can cancel restoring a volume backup by changing the status of the backup to error. But you cannot cancel restoring a backup when Red Hat Ceph Storage is the back end of the backup repository.

Before you begin

  • Ensure that the back end of your backup repository is not Red Hat Ceph Storage.
  • Only administrators can cancel restoring a volume backup.

About this task

Warning
If you cancel restoring a backup after it starts, the destination volume is useless, because there is no way of knowing how much data, if any, was actually restored.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. List the backups to obtain the name or ID of the backup that you want to stop restoring:
    $ openstack volume backup list
  3. Change the status of this backup to error to cancel its restore operation:
    $ openstack volume backup set --state error <backup>
    • Replace <backup> with the name or ID of the volume backup that you do not want to restore.

    Canceling a restore is an asynchronous action, because the back end of the backup repository must detect the change in the backup status before it cancels the restore.

Results

  • List the volume backups to verify that the restore is canceled:
    $ openstack volume backup list

    When the status of the backup changes to available, then the restore is canceled.

    1. Exit the openstackclient pod:
      $ exit