OpenStack Caracal : Cinder バックアップサービス2024/05/22 |
Cinder が提供するブロックストレージのバックアップサービスを設定します。
当例ではバックアップ用ストレージのバックエンドとして NFS を利用します。 ------------+--------------------------+--------------------------+------------ | | | 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 サーバーを稼働させておきます。 |
[2] | Storage ノードの設定です。 |
root@network:~#
apt -y install cinder-backup nfs-common
root@network:~#
vi /etc/idmapd.conf # 5行目 : コメント解除して自ドメイン名に変更 Domain = srv.world
root@network:~#
vi /etc/cinder/cinder.conf # [DEFAULT] セクション内の任意の場所へ追記
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:cinder /var/lib/cinder/backup_nfs |
[3] | 任意のユーザーで自身が所有するボリュームのバックアップを取得します。作業場所はどこでもよいですが、当例では Control ノード上で行います。 |
ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | 049a641b-4340-4158-bace- | disk-nfs | available | 10 | | | 139533f7a759 | | | | | | 142acb22-d62a-4307-b31f- | disk-lvm | available | 10 | | | d0cdfa357b45 | | | | | +----------------------------------+----------+-----------+------+-------------+ # [disk-nfs] のバックアップを [bk-disk-nfs] という名称で作成 ubuntu@dlp ~(keystone)$ openstack volume backup create --name bk-disk-nfs disk-nfs +-----------+--------------------------------------+ | Field | Value | +-----------+--------------------------------------+ | id | c8c506e3-4120-4a7d-8808-afdd2c000b56 | | name | bk-disk-nfs | | volume_id | 049a641b-4340-4158-bace-139533f7a759 | +-----------+--------------------------------------+ # 作成中は [Status] が [creating] 状態 ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------+-------------+-------------+----------+------+-------------+ | ID | Name | Description | Status | Size | Incremental | +--------------+-------------+-------------+----------+------+-------------+ | c8c506e3- | bk-disk-nfs | None | creating | 10 | False | | 4120-4a7d- | | | | | | | 8808- | | | | | | | afdd2c000b56 | | | | | | +--------------+-------------+-------------+----------+------+-------------+ # 作成完了すると [Status] が [available] となる ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------+-------------+-------------+-----------+------+-------------+ | ID | Name | Description | Status | Size | Incremental | +--------------+-------------+-------------+-----------+------+-------------+ | c8c506e3- | bk-disk-nfs | None | available | 10 | False | | 4120-4a7d- | | | | | | | 8808- | | | | | | | afdd2c000b56 | | | | | | +--------------+-------------+-------------+-----------+------+-------------+ |
[4] | バックアップ対象ボリュームのバックアップがすでに存在する場合、インクリメンタルバックアップが利用できます。 また、バックアップ対象のボリュームが特定のインスタンスにアタッチされている場合は、[--force] オプションを付加することでバックアップ実行可能です。 |
ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------+-------------+-------------+-----------+------+-------------+ | ID | Name | Description | Status | Size | Incremental | +--------------+-------------+-------------+-----------+------+-------------+ | c8c506e3- | bk-disk-nfs | None | available | 10 | False | | 4120-4a7d- | | | | | | | 8808- | | | | | | | afdd2c000b56 | | | | | | +--------------+-------------+-------------+-----------+------+-------------+ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | 049a641b-4340-4158-bace- | disk-nfs | available | 10 | | | 139533f7a759 | | | | | | 142acb22-d62a-4307-b31f- | disk-lvm | available | 10 | | | d0cdfa357b45 | | | | | +----------------------------------+----------+-----------+------+-------------+ubuntu@dlp ~(keystone)$ openstack volume backup create --name bk-disk-nfs-01 --incremental --force disk-nfs +-----------+--------------------------------------+ | Field | Value | +-----------+--------------------------------------+ | id | 685e818b-0b24-4d3b-8f08-60b8ebe782e0 | | name | bk-disk-nfs-01 | | volume_id | 049a641b-4340-4158-bace-139533f7a759 | +-----------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------+--------------+-------------+-----------+------+-------------+ | ID | Name | Description | Status | Size | Incremental | +--------------+--------------+-------------+-----------+------+-------------+ | 685e818b- | bk-disk- | None | available | 10 | False | | 0b24-4d3b- | nfs-01 | | | | | | 8f08- | | | | | | | 60b8ebe782e0 | | | | | | | c8c506e3- | bk-disk-nfs | None | available | 10 | False | | 4120-4a7d- | | | | | | | 8808- | | | | | | | afdd2c000b56 | | | | | | +--------------+--------------+-------------+-----------+------+-------------+ |
[5] | バックアップボリュームのリストアです。 リストア時はリストア対象ボリュームがインスタンスからデタッチされている必要があります。 |
ubuntu@dlp ~(keystone)$ openstack volume backup list +--------------+--------------+-------------+-----------+------+-------------+ | ID | Name | Description | Status | Size | Incremental | +--------------+--------------+-------------+-----------+------+-------------+ | 685e818b- | bk-disk- | None | available | 10 | False | | 0b24-4d3b- | nfs-01 | | | | | | 8f08- | | | | | | | 60b8ebe782e0 | | | | | | | c8c506e3- | bk-disk-nfs | None | available | 10 | False | | 4120-4a7d- | | | | | | | 8808- | | | | | | | afdd2c000b56 | | | | | | +--------------+--------------+-------------+-----------+------+-------------+ubuntu@dlp ~(keystone)$ openstack volume list +----------------------------------+----------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------------------+----------+-----------+------+-------------+ | 049a641b-4340-4158-bace- | disk-nfs | available | 10 | | | 139533f7a759 | | | | | | 142acb22-d62a-4307-b31f- | disk-lvm | available | 10 | | | d0cdfa357b45 | | | | | +----------------------------------+----------+-----------+------+-------------+ # リストア実行 ubuntu@dlp ~(keystone)$ openstack volume backup restore bk-disk-nfs-01 disk-nfs-restore # リストア中は [restoring-backup] ステータス ubuntu@dlp ~(keystone)$ openstack volume list +------------------+------------------+------------------+------+-------------+ | ID | Name | Status | Size | Attached to | +------------------+------------------+------------------+------+-------------+ | 0e0ac6ed-a037- | disk-nfs-restore | restoring-backup | 10 | | | 42e6-ab53- | | | | | | 05750d49299b | | | | | | 049a641b-4340- | disk-nfs | available | 10 | | | 4158-bace- | | | | | | 139533f7a759 | | | | | | 142acb22-d62a- | disk-lvm | available | 10 | | | 4307-b31f- | | | | | | d0cdfa357b45 | | | | | +------------------+------------------+------------------+------+-------------+ # リストア完了すると [available] ステータスになる ubuntu@dlp ~(keystone)$ openstack volume list +----------------------+------------------+-----------+------+-------------+ | ID | Name | Status | Size | Attached to | +----------------------+------------------+-----------+------+-------------+ | 0e0ac6ed-a037-42e6- | disk-nfs-restore | available | 10 | | | ab53-05750d49299b | | | | | | 049a641b-4340-4158- | disk-nfs | available | 10 | | | bace-139533f7a759 | | | | | | 142acb22-d62a-4307- | disk-lvm | available | 10 | | | b31f-d0cdfa357b45 | | | | | +----------------------+------------------+-----------+------+-------------+ |
Sponsored Link |
|