Back up an in-use volume

Usually you can only backup a volume that has an available status. But you can use the --force option when creating a backup, to back up a volume that has an in-use status.

Before you begin

  • Only volume owners and project administrators can backup volumes.
  • Your backup repository must have the necessary space.
  • The backup quotas specified for your project have not been exceeded.

About this task

When you use the --force volume backup option, you create a crash-consistent, but not an application-consistent, backup because the volume is not quiesced before performing the backup. Therefore, the data is intact but the backup does not have an awareness of which applications were running when the backup was performed.

Procedure

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

    For example:

    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | ID                                   | Name           | Status    | Size | Attached to                    |
    +--------------------------------------+----------------+-----------+------+--------------------------------+
    | 6841e3d1-8a1a-4496-bc51-f7c04b787e8f | vol_1          | available |    1 |                                |
    | 92800cf6-82ae-448a-a2bb-872fa4d98099 | Pansible_vol_2 | in-use    |    1 | Attached to inst1 on /dev/vdc  |
    +--------------------------------------+----------------+-----------+------+--------------------------------+
  3. Force the back up, if the volume that you want to backup has an in-use status:
    $ openstack volume backup create [--name <backup_name>] --force <volume>
    • Replace <volume> with the ID or name of the volume you want to back up.
    • Optional: replace <backup_name> with the name of this backup.

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

      $ openstack volume backup create --name panvol2bu1 --force Pansible_vol_2
      +-------+--------------------------------------+
      | Field | Value                                |
      +-------+--------------------------------------+
      | id    | 8c72bbf3-eb8e-4459-83e9-c7654ebe6343 |
      | name  | panvol2bu1                           |
      +-------+--------------------------------------+

Results

  • List the backups:
    $ openstack volume backup list

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

    +--------------------------------------+------------+-------------+-----------+------+
    | ID                                   | Name       | Description | Status    | Size |
    +--------------------------------------+------------+-------------+-----------+------+
    | 8c72bbf3-eb8e-4459-83e9-c7654ebe6343 | panvol2bu1    | None        | available |    1 |
    +--------------------------------------+------------+-------------+-----------+------+
    1. Exit the openstackclient pod:
      $ exit