CentOS Stream 9
Sponsored Link

OpenStack Dalmatian : Configure Cinder Backup Service2024/10/11

 

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  |  |      Open vSwitch     |  |        Libvirt        |
|  Memcached  Nginx     |  |     Neutron Server    |  |      Nova Compute     |
|  Keystone   httpd     |  |      OVN-Northd       |  |      Open vSwitch     |
|  Glance     Nova API  |  |  Nginx  iSCSI Target  |  |   OVN Metadata Agent  |
|  Cinder API           |  |  Cinder Volume/Backup |  |     OVN-Controller    |
+-----------------------+  +-----------------------+  +-----------------------+

-----------+-------------------------------------------------------------------
       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 ~]#
dnf -y install nfs-utils
[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
[root@network ~]#
systemctl enable --now openstack-cinder-backup

[root@network ~]#
chown -R cinder:cinder /var/lib/cinder/backup_nfs
# if Firewalld is running, allow service

[root@network ~]#
firewall-cmd --add-service=nfs

[root@network ~]#
firewall-cmd --runtime-to-permanent

[3] Get Backup for Cinder Volumes of yours. It's OK to work on any node. (example below is on Control Node)
[cent@dlp ~(keystone)]$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| a001f6fc-67f5-4081-979b-90e09a28b4d4 | disk-nfs | available |   10 |             |
| 056e824d-2e0f-4860-bdcd-7055051fc481 | 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        | 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 |
| name      | bk-disk-nfs                          |
| volume_id | a001f6fc-67f5-4081-979b-90e09a28b4d4 |
+-----------+--------------------------------------+

# during creation, [Status] is [creating]

[cent@dlp ~(keystone)]$
openstack volume backup list

+--------------------------------------+-------------+-------------+----------+------+-------------+
| ID                                   | Name        | Description | Status   | Size | Incremental |
+--------------------------------------+-------------+-------------+----------+------+-------------+
| 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 | bk-disk-nfs | None        | creating |   10 | False       |
+--------------------------------------+-------------+-------------+----------+------+-------------+

# after finishing creation, [Status] tunrs to [available]

[cent@dlp ~(keystone)]$
openstack volume backup list

+--------------------------------------+-------------+-------------+-----------+------+-------------+
| ID                                   | Name        | Description | Status    | Size | Incremental |
+--------------------------------------+-------------+-------------+-----------+------+-------------+
| 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 | bk-disk-nfs | None        | available |   10 | False       |
+--------------------------------------+-------------+-------------+-----------+------+-------------+
[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 | Incremental |
+--------------------------------------+-------------+-------------+-----------+------+-------------+
| 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 | bk-disk-nfs | None        | available |   10 | False       |
+--------------------------------------+-------------+-------------+-----------+------+-------------+

[cent@dlp ~(keystone)]$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| a001f6fc-67f5-4081-979b-90e09a28b4d4 | disk-nfs | available |   10 |             |
| 056e824d-2e0f-4860-bdcd-7055051fc481 | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

[cent@dlp ~(keystone)]$
openstack volume backup create --name bk-disk-nfs-01 --incremental --force disk-nfs

+-----------+--------------------------------------+
| Field     | Value                                |
+-----------+--------------------------------------+
| id        | 72465ea0-6dbf-429f-a36a-e8fe630b4792 |
| name      | bk-disk-nfs-01                       |
| volume_id | a001f6fc-67f5-4081-979b-90e09a28b4d4 |
+-----------+--------------------------------------+

[cent@dlp ~(keystone)]$
openstack volume backup list

+--------------------------------------+----------------+-------------+-----------+------+-------------+
| ID                                   | Name           | Description | Status    | Size | Incremental |
+--------------------------------------+----------------+-------------+-----------+------+-------------+
| 72465ea0-6dbf-429f-a36a-e8fe630b4792 | bk-disk-nfs-01 | None        | available |   10 | True        |
| 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 | bk-disk-nfs    | None        | available |   10 | False       |
+--------------------------------------+----------------+-------------+-----------+------+-------------+
[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 | Incremental |
+--------------------------------------+----------------+-------------+-----------+------+-------------+
| 72465ea0-6dbf-429f-a36a-e8fe630b4792 | bk-disk-nfs-01 | None        | available |   10 | True        |
| 7d5fce09-52d0-481b-bd61-5e51a44ee8a0 | bk-disk-nfs    | None        | available |   10 | False       |
+--------------------------------------+----------------+-------------+-----------+------+-------------+

[cent@dlp ~(keystone)]$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| a001f6fc-67f5-4081-979b-90e09a28b4d4 | disk-nfs | available |   10 |             |
| 056e824d-2e0f-4860-bdcd-7055051fc481 | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

# run restore

[cent@dlp ~(keystone)]$
openstack volume backup restore bk-disk-nfs-01 disk-nfs_restored


# during restore, status is [restoring-backup]

[cent@dlp ~(keystone)]$
openstack volume list

+--------------------------------------+-------------------+------------------+------+-------------+
| ID                                   | Name              | Status           | Size | Attached to |
+--------------------------------------+-------------------+------------------+------+-------------+
| 331bedaa-2d05-43e6-a9d9-afe9dd4f11d0 | disk-nfs_restored | restoring-backup |   10 |             |
| a001f6fc-67f5-4081-979b-90e09a28b4d4 | disk-nfs          | available        |   10 |             |
| 056e824d-2e0f-4860-bdcd-7055051fc481 | disk-lvm          | available        |   10 |             |
+--------------------------------------+-------------------+------------------+------+-------------+

# after finishing restore, status turns to [available]

[cent@dlp ~(keystone)]$
openstack volume list

+--------------------------------------+-------------------+-----------+------+-------------+
| ID                                   | Name              | Status    | Size | Attached to |
+--------------------------------------+-------------------+-----------+------+-------------+
| 331bedaa-2d05-43e6-a9d9-afe9dd4f11d0 | disk-nfs_restored | available |   10 |             |
| a001f6fc-67f5-4081-979b-90e09a28b4d4 | disk-nfs          | available |   10 |             |
| 056e824d-2e0f-4860-bdcd-7055051fc481 | disk-lvm          | available |   10 |             |
+--------------------------------------+-------------------+-----------+------+-------------+
Matched Content