Chapter 1. Back Up the Undercloud This guide describes how to back up the undercloud used in the Red Hat OpenStack Platform director. The undercloud is usually a single physical node (although high availability options exist using a two-node pacemaker cluster that runs director in a VM) that is used to deploy and manage your OpenStack environment. 1.1. Backup Considerations Formulate a robust back up and recovery policy in order to minimize data loss and system downtime. When determining your back up strategy, you will need to answer the following questions: How quickly will you need to recover from data loss? If you cannot have data loss at all, you should include high availability in your deployment strategy, in addition to using backups. You'll need to consider how long it will take to obtain the physical backup media (including from an offsite location, if used), and how many tape drives are available for restore operations. How many backups should you keep? You will need to consider legal and regulatory requirements that affect how long you are expected to store data. Should your backups be kept off-site? Storing your backup media offsite will help mitigate the risk of catastrophe befalling your physical location. How often should backups be tested? A robust back up strategy will include regular restoration tests of backed up data. This can help validate that the correct data is still being backed up, and that no corruption is being introduced during the back up or restoration processes. These drills should assume that they are being performed under actual disaster recovery conditions. What will be backed up? The following sections describe database and file-system backups for components, as well as information on recovering backups. 1.2. High Availability of the Undercloud node You are free to consider your preferred high availability (HA) options for the Undercloud node; Red Hat does not prescribe any particular requirements for this. For example, you might consider running your Undercloud node as a highly available virtual machine within Red Hat Enterprise Virtualization (RHEV). You might also consider using physical nodes with Pacemaker providing HA for the required services. When approaching high availability for your Undercloud node, you should consult the documentation and good practices of the solution you decide works best for your environment. 1.3. Backing up a containerized undercloud A full undercloud backup includes the following databases and files: All MariaDB databases on the undercloud node MariaDB configuration file on the undercloud so that you can accurately restore databases The configuration data: /etc Log data: /var/log Image data: /var/lib/glance Certificate generation data if using SSL: /var/lib/certmonger Any container image data: /var/lib/containers and /var/lib/image-serve All swift data: /srv/node All data in the stack user home directory: /home/stack Note Confirm that you have sufficient disk space available on the undercloud before you perform the backup process. Expect the archive file to be at least 3.5 GB. Procedure Log into the undercloud as the root user. Retrieve the password: Perform the backup: Copy the root configuration file for the database: Archive the database backup and the configuration files: The --ignore-failed-read option skips any directory that does not apply to your undercloud. The --xattrs option includes extended attributed, which are required to store metadata for Object Storage (swift). This creates a file named undercloud-backup-<date>.tar.gz , where <date> is the system date. Copy this tar file to a secure location. 1.4. Validate the Completed Backup You can validate the success of the completed back up process by running and validating the restore process. See the section for further details on restoring from backup.

Commands:
/bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password
podman exec mysql bash -c "mysqldump -uroot -pPASSWORD --opt --all-databases" > /root/undercloud-all-databases.sql
cp /var/lib/config-data/puppet-generated/mysql/root/.my.cnf ~/.
cd /backup tar --xattrs --xattrs-include='*.*' --ignore-failed-read -cf undercloud-backup-`date +%F`.tar /root/undercloud-all-databases.sql /etc /var/log /var/lib/glance /var/lib/certmonger /var/lib/containers /var/lib/image-serve /var/lib/config-data /srv/node /root /home/stack