Backing up and restoring VIM Undercloud

Prerequisites
  • Ensure that sufficient disk space is available to store the backup file.

  • Ensure that you are logged in as the root user.

  • Ensure that a backup of the Undercloud VM QCOW2 is available if you are restoring or deleting the Undercloud VM.

Procedure

Backing up Undercloud VM

  1. Log in to the Undercloud host and shut down the Undercloud VM using the following command:
    virsh shutdown undercloud
  2. Create a backup of the Undercloud VM definition file (undercloud.xml) using the following command:
    virsh dumpxml undercloud >/root/undercloud.xml
  3. Copy the Undercloud VM QCOW2 file (undercloud.qcow2), which is available in the /var/lib/libvirt/images/ directory along with the undercloud.xml file to an external media.
  4. To restart the Undercloud VM, run the following command:
    virsh start undercloud

Restoring Undercloud VM

  1. Shutdown and delete the running Undercloud VM from the Undercloud host using the following commands:
    virsh list --all
    virsh shutdown undercloud
    virsh undefine undercloud
  2. Copy the backup of the Undercloud VM QCOW2 file to the /var/lib/libvirt/images/ directory and the undercloud.xml file to the /root directory.
  3. To restore the Undercloud VM, run the following command in Undercloud host:
     virsh define /root/undercloud.xml
  4. To verify the status of the Undercloud VM, run the following command:
     virsh list --all
  5. Login to Undercloud VM and check all the services are running in the Undercloud VM as expected using the following commands:
    ssh stack@<undercloud_OAM_IP>
    source stackrc
    openstack server list
    openstack service list