OpenStack Caracal : Cinder Backup Service2024/04/09 |
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 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] | | (Control Node) | | (Network Node) | | (Compute Node) | | | | | | | | MariaDB RabbitMQ | | Neutron L2/L3 Agent | | Libvirt | | Memcached Nginx | | Neutron Metadata | | Nova Compute | | Keystone httpd | | Open vSwitch | | Neutron L2 Agent | | Glance Nova API | | iSCSI Target | | Open vSwitch | | Neutron Server | | Cinder Volume | | | | Neutron Metadata | | Cinder Backup | | | | Cinder API | | | | | +-----------------------+ +-----------------------+ +-----------------------+ -----------+------------------------------------------------------------------- eth0|10.0.0.35 +----------+-----------+ | [ nfs.srv.world ] | | NFS Server | +----------------------+ |
[1] |
NFS server is required to be running on your local network, 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@network:~#
apt -y install cinder-backup nfs-common
root@network:~#
vi /etc/idmapd.conf # line 5 : uncomment and change to own domain name Domain = srv.world
root@network:~#
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@network:~# chown -R cinder. /var/lib/cinder/backup_nfs |
[3] | Get Backup for Cinder Volumes of yours. It's OK to work on any node. (example below is on Control Node) |
ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | ec9d9ed2-502a-4f8e-869d- | disk-nfs | available | 10 | | | efe33a7ffd63 | | | | | | d02b5781-043a-40fd-a260- | disk-lvm | available | 10 | | | b6541cd21bd0 | | | | | +----------------------------------+----------+-----------+------+-------------+ # create a backup for [disk-nfs] as the new name [bk-disk-nfs] ubuntu@dlp ~(keystone)$ openstack volume backup create --name bk-disk-nfs disk-nfs +-----------+--------------------------------------+ | Field | Value | +-----------+--------------------------------------+ | id | 200d9b35-1a08-4b10-8f80-37e2c168250b | | name | bk-disk-nfs | | volume_id | ec9d9ed2-502a-4f8e-869d-efe33a7ffd63 | +-----------+--------------------------------------+ # during creation, [Status] is [creating] ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------------------------+-------------+-------------+----------+------+ | ID | Name | Description | Status | Size | +--------------------------------+-------------+-------------+----------+------+ | 200d9b35-1a08-4b10-8f80- | bk-disk-nfs | None | creating | 10 | | 37e2c168250b | | | | | +--------------------------------+-------------+-------------+----------+------+ # after finishing creation, [Status] turns to [available] ubuntu@dlp ~(keystone)$ openstack volume backup list +-------------------------------+-------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +-------------------------------+-------------+-------------+-----------+------+ | 200d9b35-1a08-4b10-8f80- | bk-disk-nfs | None | available | 10 | | 37e2c168250b | | | | | +-------------------------------+-------------+-------------+-----------+------+ |
[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. |
ubuntu@dlp ~(keystone)$ openstack volume backup list +-------------------------------+-------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +-------------------------------+-------------+-------------+-----------+------+ | 200d9b35-1a08-4b10-8f80- | bk-disk-nfs | None | available | 10 | | 37e2c168250b | | | | | +-------------------------------+-------------+-------------+-----------+------+ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | ec9d9ed2-502a-4f8e-869d- | disk-nfs | available | 10 | | | efe33a7ffd63 | | | | | | d02b5781-043a-40fd-a260- | disk-lvm | available | 10 | | | b6541cd21bd0 | | | | | +----------------------------------+----------+-----------+------+-------------+ubuntu@dlp ~(keystone)$ openstack volume backup create --name bk-disk-nfs-01 --incremental --force disk-nfs +-----------+--------------------------------------+ | Field | Value | +-----------+--------------------------------------+ | id | 39d6026b-82f9-4da2-9c69-6a4da24660b5 | | name | bk-disk-nfs-01 | | volume_id | ec9d9ed2-502a-4f8e-869d-efe33a7ffd63 | +-----------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack volume backup list +----------------------+----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +----------------------+----------------+-------------+-----------+------+ | 39d6026b-82f9-4da2- | bk-disk-nfs-01 | None | available | 10 | | 9c69-6a4da24660b5 | | | | | | 200d9b35-1a08-4b10- | bk-disk-nfs | None | available | 10 | | 8f80-37e2c168250b | | | | | +----------------------+----------------+-------------+-----------+------+ |
[5] | For restoring from Backups, run commands like follows. For restoring, target volume must be detached from any instances. |
ubuntu@dlp ~(keystone)$ openstack volume backup list +----------------------+----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +----------------------+----------------+-------------+-----------+------+ | 39d6026b-82f9-4da2- | bk-disk-nfs-01 | None | available | 10 | | 9c69-6a4da24660b5 | | | | | | 200d9b35-1a08-4b10- | bk-disk-nfs | None | available | 10 | | 8f80-37e2c168250b | | | | | +----------------------+----------------+-------------+-----------+------+ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | ec9d9ed2-502a-4f8e-869d- | disk-nfs | available | 10 | | | efe33a7ffd63 | | | | | | d02b5781-043a-40fd-a260- | disk-lvm | available | 10 | | | b6541cd21bd0 | | | | | +----------------------------------+----------+-----------+------+-------------+ # run restore ubuntu@dlp ~(keystone)$ openstack volume backup restore bk-disk-nfs-01 disk-nfs-restore # during restore, status is [restoring-backup] ubuntu@dlp ~(keystone)$ openstack volume list +------------------+------------------+------------------+------+-------------+ | ID | Name | Status | Size | Attached to | +------------------+------------------+------------------+------+-------------+ | 77185e80-7393- | disk-nfs-restore | restoring-backup | 10 | | | 4a81-a19a- | | | | | | 9bde24fd9792 | | | | | | ec9d9ed2-502a- | disk-nfs | available | 10 | | | 4f8e-869d- | | | | | | efe33a7ffd63 | | | | | | d02b5781-043a- | disk-lvm | available | 10 | | | 40fd-a260- | | | | | | b6541cd21bd0 | | | | | +------------------+------------------+------------------+------+-------------+ # after finishing restore, status turns to [available] ubuntu@dlp ~(keystone)$ openstack volume list +----------------------+------------------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------+------------------+-----------+------+-------------+ | 77185e80-7393-4a81- | disk-nfs-restore | available | 10 | | | a19a-9bde24fd9792 | | | | | | ec9d9ed2-502a-4f8e- | disk-nfs | available | 10 | | | 869d-efe33a7ffd63 | | | | | | d02b5781-043a-40fd- | disk-lvm | available | 10 | | | a260-b6541cd21bd0 | | | | | +----------------------+------------------+-----------+------+-------------+ |
Sponsored Link |
|