From d4e9281e2069257eebeb088507a29be265a7508c Mon Sep 17 00:00:00 2001 From: egoncalv Date: Wed, 14 Jul 2021 13:50:31 -0300 Subject: [PATCH] Export and import Ceph Cinder backup Created doc "Export and Import Cinder Backups to Ceph Pool" under System Configuration Added include file downstream Corrected formatting Included doc improvements requested by Daniel Changed format of explaining the commands and removed notes. Worked on Mary's comments about text formatting. Signed-off-by: egoncalv Change-Id: I3e7c74aa6c1c3f76af90cac274badcad040fa42f --- ...nd-import-cinder-backups-to-ceph-pool.rest | 2 + ...and-import-cinder-backups-to-ceph-pool.rst | 123 ++++++++++++++++++ .../system_configuration/openstack/index.rst | 11 +- 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 doc/source/_includes/export-and-import-cinder-backups-to-ceph-pool.rest create mode 100644 doc/source/system_configuration/openstack/export-and-import-cinder-backups-to-ceph-pool.rst diff --git a/doc/source/_includes/export-and-import-cinder-backups-to-ceph-pool.rest b/doc/source/_includes/export-and-import-cinder-backups-to-ceph-pool.rest new file mode 100644 index 000000000..9dc7b2aa0 --- /dev/null +++ b/doc/source/_includes/export-and-import-cinder-backups-to-ceph-pool.rest @@ -0,0 +1,2 @@ +.. location-ceph-begin +.. location-ceph-end diff --git a/doc/source/system_configuration/openstack/export-and-import-cinder-backups-to-ceph-pool.rst b/doc/source/system_configuration/openstack/export-and-import-cinder-backups-to-ceph-pool.rst new file mode 100644 index 000000000..1d67b0124 --- /dev/null +++ b/doc/source/system_configuration/openstack/export-and-import-cinder-backups-to-ceph-pool.rst @@ -0,0 +1,123 @@ + +.. _export-and-import-cinder-backups-to-ceph-pool: + +============================================= +Export and Import Cinder Backups to Ceph Pool +============================================= + +This document describes how to export and import Cinder backups stored in Ceph +pool, along with their respective metadata. + +.. rubric:: |prereq| + +#. |prefix|-openstack application is applied, up and running. + +#. The user has OpenStack admin credentials. + +--------------------------------- +Create and Export a Volume Backup +--------------------------------- + +Cinder doesn't guarantee the data consistency during a backup operation, so if +the volume to be backed up is attached to a running VM and the application in the +VM is not crash consistent, the recommended approach is to stop the VM for the +backup procedure. Check the OpenStack documentation +`Back up and restore volumes and snapshots +`__ +for more details. + +.. rubric:: |proc| + +#. Create a volume backup: + + If the volume to be backed up is attached to a running VM, stop the VM first: + + .. code-block:: none + + $ openstack server stop + + Then, create the backup: + + .. code-block:: none + + $ openstack volume backup create --force [--name ] + + where: + + ``--name`` is optional. + + ``--force`` allows you to back up an "in-use" volume. + + .. only:: partner + + .. include:: /_includes/export-and-import-cinder-backups-to-ceph-pool.rest + :start-after: location-ceph-begin + :end-before: location-ceph-end + +#. Export the backup image from Ceph pool: + + .. code-block:: none + + $ rbd list -p cinder.backups + $ rbd export -p cinder.backups + + where ```` uses the format + ``volume-.backup.``. + +#. Export the backup metadata from Cinder database: + + .. code-block:: none + + $ cinder backup-export > + +---------------------------------- +Import and Restore a Volume Backup +---------------------------------- + +.. rubric:: |proc| + +#. Import the backup metadata to Cinder database: + + .. code-block:: none + + $ backup_service=`grep "backup_service" | awk '{ print $4 }'` + $ backup_url=`grep "backup_url" | awk '{ print $4 }'` + $ cinder backup-import $backup_service $backup_url + +#. Import the backup image to Ceph pool. + + Check the ID of volume from which the backup was created: + + .. code-block:: none + + $ openstack volume backup show + + Import the backup image to Ceph pool: + + .. code-block:: none + + $ rbd import cinder.backups/volume-.backup.base + +#. Restore the backup to a new volume. + + If the volume in which the backup will be restored is attached to a VM, + stop the VM and set the volume status to ``available``: + + .. code-block:: none + + $ openstack server stop + $ openstack volume set --state "available" + + Then, restore the backup: + + .. code-block:: none + + $ openstack volume backup restore + + If the volume was attached to a VM before the restore operation, set the + volume status to ``in-use`` before starting the VM: + + .. code-block:: none + + $ openstack volume set --state "in-use" + $ openstack server start \ No newline at end of file diff --git a/doc/source/system_configuration/openstack/index.rst b/doc/source/system_configuration/openstack/index.rst index d73b9db28..c250882c0 100644 --- a/doc/source/system_configuration/openstack/index.rst +++ b/doc/source/system_configuration/openstack/index.rst @@ -22,4 +22,13 @@ Configure OpenStack Services Using Helm Chart Overrides using-helm-overrides-to-enable-internal-dns adding-configuration-rpc-response-max-timeout-in-neutron-conf assigning-a-dedicated-vlan-id-to-a-target-project-network - customize-openstack-horizon-and-login-banner-branding \ No newline at end of file + customize-openstack-horizon-and-login-banner-branding + +------ +Cinder +------ + +.. toctree:: + :maxdepth: 1 + + export-and-import-cinder-backups-to-ceph-pool \ No newline at end of file