docs/doc/source/backup/openstack/restore-openstack-from-a-backup.rst
Ron Stone f125a8b892 Remove spurious escapes (r8,dsR8)
This change addresses a long-standing issue in rST documentation imported from XML.
That import process added backslash escapes in front of various characters. The three
most common being '(', ')', and '_'.
These instances are removed.

Signed-off-by: Ron Stone <ronald.stone@windriver.com>
Change-Id: Id43a9337ffcd505ccbdf072d7b29afdb5d2c997e
2023-03-01 11:19:04 +00:00

4.6 KiB

Restore OpenStack from a Backup

You can restore from a backup with or without Ceph.

  • You must have a backup of your installation as described in Back up OpenStack <back-up-openstack>.
  • You must have an operational deployment.

  1. Delete the old OpenStack application and upload it again.

    Note

    Images and volumes will remain in Ceph.

    ~(keystone_admin)$ system application-remove -openstack ~(keystone_admin)$ system application-delete -openstack ~(keystone_admin)$ system application-upload -openstack.tgz

  2. Restore .

    You can choose either of the following options:

    • Restore only system data. This option will not restore the Ceph data (that is, it will not run commands like rbd import). This procedure will preserve any existing Ceph data at restore-time.
    • Restore system data, Cinder volumes and Glance images. You'll want to run this step if your Ceph data will be wiped after the backup.

Restore only application system data

Run the following command:

~(keystone_admin)$ ansible-playbook /usr/share/ansible/stx-ansible/playbooks/ restore_openstack.yml -e "@localhost-restore.yaml"
cat << EOF > localhost-restore.yaml
---
ansible_become_pass: "<admin_password>"
admin_password: "<admin_password>"
initial_backup_dir: "<location_of_backup_filename>"
backup_filename: "<openstack_tgz_backup_filename>"
...
EOF

Restore application system data, cinder volumes and glance images

  1. Run the following command:

    ~(keystone_admin)$ ansible-playbook /usr/share/ansible/stx-ansible/playbooks/ restore_openstack.yml -e "@localhost-restore.yaml"
    cat << EOF > localhost-restore.yaml
    ---
    ansible_become_pass: "<admin_password>"
    admin_password: "<admin_password>"
    initial_backup_dir: "<location_of_backup_filename>"
    backup_filename: "<openstack_tgz_backup_filename>"
    restore_cinder_glance_data="true"
    ...
    EOF

    When this step has completed, the Cinder, Glance and MariaDB services will be up, and Mariadb data restored.

  2. Restore Ceph data.

    1. Restore Cinder volumes using the rbd import command.

      For example:

      ~(keystone_admin)$ rbd import -p cinder-volumes /tmp/611157b9-78a4-4a26-af16-f9ff75a85e1b

      Where tmp/611157b9-78a4-4a26-af16-f9ff75a85e1b is a file saved earlier at the backup procedure as described in Back up OpenStack<back-up-openstack>.

    2. Restore Glance images using the image-backup script.

      For example, if we have an archive named image_3f30adc2-3e7c-45bf-9d4b-a4c1e191d879.tgz in the /opt/backups directory, we can use restore it using the following command:

      ~(keystone_admin)$ sudo image-backup.sh import image_3f30adc2-3e7c-45bf-9d4b-a4c1e191d879.tgz
    3. Use the tidy_storage_post_restore utility to detect any discrepancy between Cinder/Glance DB and rbd pools:

      ~(keystone_admin)$ tidy_storage_post_restore <log_file>

      After the script finishes, some command output will be written to the log file. They will help reconcile discrepancies between the database and CEPH data.

  3. Run the playbook again with the restore_openstack_continue flag set to true to bring up the remaining OpenStack services.

    ~(keystone_admin)$ ansible-playbook /usr/share/ansible/stx-ansible/playbooks/ restore_openstack.yml -e "@localhost-restore.yaml"
    cat << EOF > localhost-restore.yaml
    ---
    ansible_become_pass: "<admin_password>"
    admin_password: "<admin_password>"
    initial_backup_dir: "<location_of_backup_filename>"
    backup_filename: "<openstack_tgz_backup_filename>"
    restore_openstack_continue="true"
    ...
    EOF