OpenStack Rocky : Cinder Backup Service2019/08/21 |
Configure Cinder Backup Service for Cinder block storages.
This example shows to configure NFS backend for backup storage.
For other backends, It's possible to confugire GlusterFS, Ceph, Object Storage(Swift), and others. ------------+-------------------------+-------------------------+-------------+--- | | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 | +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | | [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] | | | | | | | | | | MariaDB RabbitMQ | | | | Libvirt | | | Memcached httpd | | L2 Agent | | Nova Compute | | | Keystone Glance | | L3 Agent | | L2 Agent | | | Nova API | | Metadata Agent | | | | | Neutron Server | | Cinder Volume | | | | | Metadata Agent | | | | | | | Cinder API | | | | | | +-----------------------+ +-----------------------+ +-----------------------+ | -----------+------------------------------------------------------------------+ eth0|10.0.0.35 +----------+-----------+ | [ NFS Server ] | | | +----------------------+ |
[1] |
NFS server is required to be running on your LAN, refer to here.
On this example, configure [/var/lib/cinder-backup] directory on [nfs.srv.world] as a backup directory. |
[2] | Configure Storage Node. |
root@storage:~#
apt -y install cinder-backup nfs-common
root@storage:~#
vi /etc/idmapd.conf # line 6: uncomment and change to own domain name Domain = srv.world
root@storage:~#
vi /etc/cinder/cinder.conf # add follows into [DEFAULT] section
backup_driver = cinder.backup.drivers.nfs.NFSBackupDriver
backup_mount_point_base = $state_path/backup_nfs backup_share = nfs.srv.world:/var/lib/cinder-backup systemctl restart cinder-backup root@storage:~# chown -R cinder. /var/lib/cinder/backup_nfs |
[3] | Get Backup for Cinder Volumes of yours. It's OK to work on any node. (This example is on Control Node) |
debian@dlp ~(keystone)$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | e073e628-8316-4fcb-a831-c6ca85ff2e36 | disk_nfs | available | 10 | | | 54f21e8f-af6b-4676-ab55-69411da6a3b8 | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ # create a backup for [disk_lvm] as the new name [backup-disk_lvm] debian@dlp ~(keystone)$ openstack volume backup create --name backup-disk_lvm disk_lvm +-------+--------------------------------------+ | Field | Value | +-------+--------------------------------------+ | id | af888485-3df7-4e48-a1bd-f97d4bdf0130 | | name | backup-disk_lvm | +-------+--------------------------------------+ # during cretation, [Status] is [creating] debian@dlp ~(keystone)$ openstack volume backup list +--------------------------------------+-----------------+-------------+----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-----------------+-------------+----------+------+ | af888485-3df7-4e48-a1bd-f97d4bdf0130 | backup-disk_lvm | None | creating | 10 | +--------------------------------------+-----------------+-------------+----------+------+ # after finishing creation, [Status] tunrs to [available] debian@dlp ~(keystone)$ openstack volume backup list +--------------------------------------+-----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-----------------+-------------+-----------+------+ | af888485-3df7-4e48-a1bd-f97d4bdf0130 | backup-disk_lvm | None | available | 10 | +--------------------------------------+-----------------+-------------+-----------+------+ |
[4] | If there is a backup file of target storage you'd like to get backup, it's possible to get incremental backup. Furthermore, if target storage you'd like to get backup is now attaching on an Instance, specify [--force] option to get backup forcely. |
debian@dlp ~(keystone)$ openstack volume backup list +--------------------------------------+-----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-----------------+-------------+-----------+------+ | af888485-3df7-4e48-a1bd-f97d4bdf0130 | backup-disk_lvm | None | available | 10 | +--------------------------------------+-----------------+-------------+-----------+------+debian@dlp ~(keystone)$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | e073e628-8316-4fcb-a831-c6ca85ff2e36 | disk_nfs | available | 10 | | | 54f21e8f-af6b-4676-ab55-69411da6a3b8 | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+debian@dlp ~(keystone)$ openstack volume backup create --name backup-disk_lvm-01 --incremental --force disk_lvm +-------+--------------------------------------+ | Field | Value | +-------+--------------------------------------+ | id | 1fa20f54-d253-4335-8e81-7efcd24bc303 | | name | backup-disk_lvm-01 | +-------+--------------------------------------+debian@dlp ~(keystone)$ openstack volume backup list +--------------------------------------+--------------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+--------------------+-------------+-----------+------+ | 1fa20f54-d253-4335-8e81-7efcd24bc303 | backup-disk_lvm-01 | None | available | 10 | | af888485-3df7-4e48-a1bd-f97d4bdf0130 | backup-disk_lvm | None | available | 10 | +--------------------------------------+--------------------+-------------+-----------+------+ |
[5] | For restoring from Backups, run commands like follows. For restoring, target volume must be detached from any instances. |
debian@dlp ~(keystone)$ openstack volume backup list +--------------------------------------+--------------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+--------------------+-------------+-----------+------+ | 1fa20f54-d253-4335-8e81-7efcd24bc303 | backup-disk_lvm-01 | None | available | 10 | | af888485-3df7-4e48-a1bd-f97d4bdf0130 | backup-disk_lvm | None | available | 10 | +--------------------------------------+--------------------+-------------+-----------+------+debian@dlp ~(keystone)$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | e073e628-8316-4fcb-a831-c6ca85ff2e36 | disk_nfs | available | 10 | | | 54f21e8f-af6b-4676-ab55-69411da6a3b8 | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ # run restore debian@dlp ~(keystone)$ openstack volume backup restore backup-disk_lvm disk_lvm cannot unpack non-iterable VolumeBackupsRestore object # during restore, status is [restoring-backup] debian@dlp ~(keystone)$ openstack volume list +--------------------------------------+----------+------------------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+------------------+------+-------------+ | e073e628-8316-4fcb-a831-c6ca85ff2e36 | disk_nfs | available | 10 | | | 54f21e8f-af6b-4676-ab55-69411da6a3b8 | disk_lvm | restoring-backup | 10 | | +--------------------------------------+----------+------------------+------+-------------+ # after finishing restore, status turns to [available] debian@dlp ~(keystone)$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | e073e628-8316-4fcb-a831-c6ca85ff2e36 | disk_nfs | available | 10 | | | 54f21e8f-af6b-4676-ab55-69411da6a3b8 | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ |
Sponsored Link |