OpenStack Ussuri : Configure Cinder Backup Service2020/06/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 | +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | | [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] | | | | | | | | | | MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | | Memcached httpd | | L2 Agent | | Nova Compute | | | Keystone Glance | | L3 Agent | | Open vSwitch | | | Nova API | | Metadata Agent | | L2 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 ~]#
dnf -y install nfs-utils
[root@storage ~]#
vi /etc/idmapd.conf # line 5: 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 enable --now openstack-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. (example bwlow is on Control Node) |
[cent@dlp ~(keystone)]$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | disk_nfs | available | 10 | | | 11a88a46-4fb7-4b98-890e-823ffdae952e | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ # create a backup for [disk_nfs] as the new name [bk-disk_nfs] [cent@dlp ~(keystone)]$ openstack volume backup create --name bk-disk_nfs disk_nfs +-------+--------------------------------------+ | Field | Value | +-------+--------------------------------------+ | id | d9712e9c-c49a-44c3-b987-054597409354 | | name | bk-disk_nfs | +-------+--------------------------------------+ # during cretation, [Status] is [creating] [cent@dlp ~(keystone)]$ openstack volume backup list +--------------------------------------+-------------+-------------+----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-------------+-------------+----------+------+ | d9712e9c-c49a-44c3-b987-054597409354 | bk-disk_nfs | None | creating | 10 | +--------------------------------------+-------------+-------------+----------+------+ # after finishing creation, [Status] tunrs to [available] [cent@dlp ~(keystone)]$ openstack volume backup list +--------------------------------------+-------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-------------+-------------+-----------+------+ | d9712e9c-c49a-44c3-b987-054597409354 | bk-disk_nfs | 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. |
[cent@dlp ~(keystone)]$ openstack volume backup list +--------------------------------------+-------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+-------------+-------------+-----------+------+ | d9712e9c-c49a-44c3-b987-054597409354 | bk-disk_nfs | None | available | 10 | +--------------------------------------+-------------+-------------+-----------+------+[cent@dlp ~(keystone)]$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | disk_nfs | available | 10 | | | 11a88a46-4fb7-4b98-890e-823ffdae952e | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+[cent@dlp ~(keystone)]$ openstack volume backup create --name bk-disk_nfs-01 --incremental --force disk_nfs +-------+--------------------------------------+ | Field | Value | +-------+--------------------------------------+ | id | ff6552fe-61d9-44d1-9541-5238876413e7 | | name | bk-disk_nfs-01 | +-------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack volume backup list +--------------------------------------+----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+----------------+-------------+-----------+------+ | ff6552fe-61d9-44d1-9541-5238876413e7 | bk-disk_nfs-01 | None | available | 10 | | d9712e9c-c49a-44c3-b987-054597409354 | bk-disk_nfs | None | available | 10 | +--------------------------------------+----------------+-------------+-----------+------+ |
[5] | For restoring from Backups, run commands like follows. For restoring, target volume must be detached from any instances. |
[cent@dlp ~(keystone)]$ openstack volume backup list +--------------------------------------+----------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+----------------+-------------+-----------+------+ | ff6552fe-61d9-44d1-9541-5238876413e7 | bk-disk_nfs-01 | None | available | 10 | | d9712e9c-c49a-44c3-b987-054597409354 | bk-disk_nfs | None | available | 10 | +--------------------------------------+----------------+-------------+-----------+------+[cent@dlp ~(keystone)]$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | disk_nfs | available | 10 | | | 11a88a46-4fb7-4b98-890e-823ffdae952e | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ # run restore [cent@dlp ~(keystone)]$ openstack volume backup restore bk-disk_nfs-01 disk_nfs +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | backup_id | ff6552fe-61d9-44d1-9541-5238876413e7 | | volume_id | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | | volume_name | disk_nfs | +-------------+--------------------------------------+ # during restore, status is [restoring-backup] [cent@dlp ~(keystone)]$ openstack volume list +--------------------------------------+----------+------------------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+------------------+------+-------------+ | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | disk_nfs | restoring-backup | 10 | | | 11a88a46-4fb7-4b98-890e-823ffdae952e | disk_lvm | available | 10 | | +--------------------------------------+----------+------------------+------+-------------+ # after finishing restore, status turns to [available] [cent@dlp ~(keystone)]$ openstack volume list +--------------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------+-----------+------+-------------+ | 2584addf-52bb-4488-8d15-d0e29e3a9aa2 | disk_nfs | available | 10 | | | 11a88a46-4fb7-4b98-890e-823ffdae952e | disk_lvm | available | 10 | | +--------------------------------------+----------+-----------+------+-------------+ |
Sponsored Link |