Back up and restore volumesThe cinder command-line interface provides the tools for creating a
volume backup. You can restore a volume from a backup as long as the backup's associated
database information (or backup metadata) is intact in the Block Storage database.Run this command to create a backup of a volume:$cinder backup-create [--incremental] VOLUMEWhere VOLUME is the name or ID of the volume,
and is a flag that indicates whether an
incremental backup should be performed.Without the flag, a full backup is
created by default. With the flag, an
incremental backup is created.The flag is only available for
block storage API v2. You have to specify [--os-volume-api-version 2]
in the cinder command-line interface to use this
parameter.The incremental backup is based on a parent backup which is an
existing backup with the latest timestamp. The parent backup can be a full
backup or an incremental backup depending on the timestamp.The first backup of a volume has to be a full backup. Attempting
to do an incremental backup without any existing backups will fail.
A new configure option
is introduced into cinder.conf for the default Swift
backup driver. This is the size in bytes that changes are tracked for
incremental backups. The existing option, the size in bytes of Swift backup objects, has to be a
multiple of . The default is 32768
for , and the default is 52428800
for .
This command also returns a backup ID. Use this backup ID when restoring the volume:$cinder backup-restore BACKUP_IDWhen restoring from a full backup, it is a full restore.When restoring from an incremental backup, a list of backups is
built based on the IDs of the parent backups. A full restore is
performed based on the full backup first, then restore is done based
on the incremental backup, laying on top of it in order.Because volume backups are dependent on the Block Storage database, you must also back up
your Block Storage database regularly to ensure data recovery.Alternatively, you can export and save the metadata of selected volume backups. Doing so
precludes the need to back up the entire Block Storage database. This is useful if you need
only a small subset of volumes to survive a catastrophic database failure.If you specify a UUID encryption key when setting up the volume specifications, the
backup metadata ensures that the key will remain valid when you back up and restore
the volume.For more information about how to export and import volume backup metadata, see .By default, the swift object store is used for the backup repository.
If instead you want to use an NFS export as the backup repository,
add the following configuration options to the
[DEFAULT] section of the
cinder.conf file and restart the Block
Storage services:
backup_driver = cinder.backup.drivers.nfs
backup_share = HOST:EXPORT_PATH
For the option, replace
HOST with the DNS resolvable host name or
the IP address of the storage server for the NFS share, and
EXPORT_PATH with the path to that
share. If your environment requires that non-default mount
options be specified for the share, set these as follows:
backup_mount_options = MOUNT_OPTIONSMOUNT_OPTIONS is a comma-separated
string of NFS mount options as detailed in the NFS man page.
There are several other options whose default values may be overriden as appropriate for your environment:
backup_compression_algorithm = zlib
backup_sha_block_size_bytes = 32768
backup_file_size = 1999994880
The option can be
set to bz2 or None. The
latter can be a useful setting when the server providing the share
for the backup repository itself performs deduplication or
compression on the backup data.
The option must be a multiple of
. It is effectively
the maximum file size to be used, given your environment, to hold
backup data. Volumes larger than this will be stored in multiple
files in the backup repository. The
option determines the size
of blocks from the cinder volume being backed up on which digital
signatures are calculated in order to enable incremental
backup capability.