Ubuntu 20.04
Sponsored Link

OpenStack Yoga : Cinder Backup Service2022/04/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
|  +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|  |    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
|  |                       |   |                       |   |                       |
|  |  MariaDB    RabbitMQ  |   |      Open vSwitch     |   |        Libvirt        |
|  |  Memcached  httpd     |   |     Neutron Server    |   |     Nova Compute      |
|  |  Keystone   Glance    |   |       OVN-Northd      |   |      Open vSwitch     |
|  |  Nova API             |   |     Cinder Volume     |   |   OVN Metadata Agent  |
|  |  Cinder API           |   |     Cinder Backup     |   |     OVN-Controller    |
|  +-----------------------+   +-----------------------+   +-----------------------+
|
+--------------+----------------------------------------------------------------------
           eth0|10.0.0.35
    +----------+-----------+
    |   [  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@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
root@storage:~#
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. (example bwlow is on Control Node)
ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 1da987f5-cc84-402c-87af-bb8ea04e09f5 | disk-nfs | available |   10 |             |
| 178a99c3-721c-4737-8960-5a8024a8f3fa | 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    | 14263d1f-227f-44a4-b5df-f9bda8b404a8 |
| name  | bk-disk-nfs                          |
+-------+--------------------------------------+

# during cretation, [Status] is [creating]

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

+--------------------------------------+-------------+-------------+----------+------+
| ID                                   | Name        | Description | Status   | Size |
+--------------------------------------+-------------+-------------+----------+------+
| 14263d1f-227f-44a4-b5df-f9bda8b404a8 | 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 |
+--------------------------------------+-------------+-------------+-----------+------+
| 14263d1f-227f-44a4-b5df-f9bda8b404a8 | 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 |
+--------------------------------------+-------------+-------------+-----------+------+
| 14263d1f-227f-44a4-b5df-f9bda8b404a8 | bk-disk-nfs | None        | available |   10 |
+--------------------------------------+-------------+-------------+-----------+------+

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 1da987f5-cc84-402c-87af-bb8ea04e09f5 | disk-nfs | available |   10 |             |
| 178a99c3-721c-4737-8960-5a8024a8f3fa | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

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

+-------+--------------------------------------+
| Field | Value                                |
+-------+--------------------------------------+
| id    | 2f937721-8c36-42db-aa1e-7dc96c3f00c4 |
| name  | bk-disk-nfs-01                       |
+-------+--------------------------------------+

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

+--------------------------------------+----------------+-------------+-----------+------+
| ID                                   | Name           | Description | Status    | Size |
+--------------------------------------+----------------+-------------+-----------+------+
| 2f937721-8c36-42db-aa1e-7dc96c3f00c4 | bk-disk-nfs-01 | None        | available |   10 |
| 14263d1f-227f-44a4-b5df-f9bda8b404a8 | 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 |
+--------------------------------------+----------------+-------------+-----------+------+
| 2f937721-8c36-42db-aa1e-7dc96c3f00c4 | bk-disk-nfs-01 | None        | available |   10 |
| 14263d1f-227f-44a4-b5df-f9bda8b404a8 | bk-disk-nfs    | None        | available |   10 |
+--------------------------------------+----------------+-------------+-----------+------+

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 1da987f5-cc84-402c-87af-bb8ea04e09f5 | disk-nfs | available |   10 |             |
| 178a99c3-721c-4737-8960-5a8024a8f3fa | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+

# run restore

ubuntu@dlp ~(keystone)$
openstack volume backup restore bk-disk-nfs-01 disk-nfs

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| backup_id   | 2f937721-8c36-42db-aa1e-7dc96c3f00c4 |
| volume_id   | 1da987f5-cc84-402c-87af-bb8ea04e09f5 |
| volume_name | disk-nfs                             |
+-------------+--------------------------------------+

# during restore, status is [restoring-backup]

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+------------------+------+-------------+
| ID                                   | Name     | Status           | Size | Attached to |
+--------------------------------------+----------+------------------+------+-------------+
| 1da987f5-cc84-402c-87af-bb8ea04e09f5 | disk-nfs | restoring-backup |   10 |             |
| 178a99c3-721c-4737-8960-5a8024a8f3fa | disk-lvm | available        |   10 |             |
+--------------------------------------+----------+------------------+------+-------------+

# after finishing restore, status turns to [available]

ubuntu@dlp ~(keystone)$
openstack volume list

+--------------------------------------+----------+-----------+------+-------------+
| ID                                   | Name     | Status    | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 1da987f5-cc84-402c-87af-bb8ea04e09f5 | disk-nfs | available |   10 |             |
| 178a99c3-721c-4737-8960-5a8024a8f3fa | disk-lvm | available |   10 |             |
+--------------------------------------+----------+-----------+------+-------------+
Matched Content