Ubuntu 22.04
Sponsored Link

OpenStack Bobcat : Cinder Backup Service2023/10/06

 
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:~#
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
root@network:~#
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 |
+--------------------------------------+----------+-----------+------+-------------+
| 35c491aa-bd3a-4e9b-8596-3e312f5dba25 | disk-nfs | available |   10 |             |
| b094dc86-faab-44f1-a3ed-9300819fd2ce | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

# 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        | aaf978c5-5649-4011-a866-e6b933cab8e9 |
| name      | bk-disk-nfs                          |
| volume_id | 35c491aa-bd3a-4e9b-8596-3e312f5dba25 |
+-----------+--------------------------------------+

# during creation, [Status] is [creating]

ubuntu@dlp ~(keystone)$
openstack volume backup list

+--------------------------------------+-------------+-------------+----------+------+
| ID                                   | Name        | Description | Status   | Size |
+--------------------------------------+-------------+-------------+----------+------+
| aaf978c5-5649-4011-a866-e6b933cab8e9 | bk-disk-nfs | None        | creating |   10 |
+--------------------------------------+-------------+-------------+----------+------+

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

ubuntu@dlp ~(keystone)$
openstack volume backup list

+--------------------------------------+-------------+-------------+-----------+------+
| ID                                   | Name        | Description | Status    | Size |
+--------------------------------------+-------------+-------------+-----------+------+
| aaf978c5-5649-4011-a866-e6b933cab8e9 | 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.
ubuntu@dlp ~(keystone)$
openstack volume backup list

+--------------------------------------+-------------+-------------+-----------+------+
| ID                                   | Name        | Description | Status    | Size |
+--------------------------------------+-------------+-------------+-----------+------+
| aaf978c5-5649-4011-a866-e6b933cab8e9 | bk-disk-nfs | None        | available |   10 |
+--------------------------------------+-------------+-------------+-----------+------+

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 35c491aa-bd3a-4e9b-8596-3e312f5dba25 | disk-nfs | available |   10 |             |
| b094dc86-faab-44f1-a3ed-9300819fd2ce | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

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

+-----------+--------------------------------------+
| Field     | Value                                |
+-----------+--------------------------------------+
| id        | ef441d9f-a8d2-48b2-bcd4-c7433a78933a |
| name      | bk-disk-nfs-01                       |
| volume_id | 35c491aa-bd3a-4e9b-8596-3e312f5dba25 |
+-----------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack volume backup list

+--------------------------------------+----------------+-------------+-----------+------+
| ID                                   | Name           | Description | Status    | Size |
+--------------------------------------+----------------+-------------+-----------+------+
| 50f3baa6-5cae-4656-839a-30de9a620fc5 | bk-disk-nfs-01 | None        | available |   10 |
| 4537c913-2822-40ef-8de8-178f4b0610ac | 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.
ubuntu@dlp ~(keystone)$
openstack volume backup list

+--------------------------------------+----------------+-------------+-----------+------+
| ID                                   | Name           | Description | Status    | Size |
+--------------------------------------+----------------+-------------+-----------+------+
| ef441d9f-a8d2-48b2-bcd4-c7433a78933a | bk-disk-nfs-01 | None        | available |   10 |
| aaf978c5-5649-4011-a866-e6b933cab8e9 | bk-disk-nfs    | None        | available |   10 |
+--------------------------------------+----------------+-------------+-----------+------+

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 35c491aa-bd3a-4e9b-8596-3e312f5dba25 | disk-nfs | available |   10 |             |
| b094dc86-faab-44f1-a3ed-9300819fd2ce | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

# 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 |
+--------------------------------------+------------------+------------------+------+-------------+
| 66ff9ca5-bf04-4445-a7ff-d8d8b2a578b9 | disk-nfs-restore | restoring-backup |   10 |             |
| 35c491aa-bd3a-4e9b-8596-3e312f5dba25 | disk-nfs         | available        |   10 |             |
| b094dc86-faab-44f1-a3ed-9300819fd2ce | disk-lvm         | available        |   10 |             |
+--------------------------------------+------------------+------------------+------+-------------+

# after finishing restore, status turns to [available]

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+------------------+-----------+------+-------------+
| ID                                   | Name             | Status    | Size | Attached to |
+--------------------------------------+------------------+-----------+------+-------------+
| 66ff9ca5-bf04-4445-a7ff-d8d8b2a578b9 | disk-nfs-restore | available |   10 |             |
| 35c491aa-bd3a-4e9b-8596-3e312f5dba25 | disk-nfs         | available |   10 |             |
| b094dc86-faab-44f1-a3ed-9300819fd2ce | disk-lvm         | available |   10 |             |
+--------------------------------------+------------------+-----------+------+-------------+
Matched Content