Chapter 2. Restoring a containerized undercloud The following restore procedure assumes your undercloud node has failed and is in an unrecoverable state. This procedure involves restoring the database and critical filesystems on a fresh installation. It assumes the following: You have re-installed the latest version of Red Hat Enterprise Linux 8. The hardware layout is the same. The hostname and undercloud settings of the machine are the same. The backup archive has been copied to the root directory. Procedure Log into your undercloud as the root user. Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted: Attach the Red Hat OpenStack Platform entitlement: Disable all default repositories, and then enable the required Red Hat Enterprise Linux repositories: Perform an update on your system to make sure you have the latest base system packages: Ensure the time on your undercloud is synchronized. For example: Copy the undercloud backup archive to the undercloud's root directory. The following steps use undercloud-backup-USDTIMESTAMP.tar as the filename, where USDTIMESTAMP is a Bash variable for the timestamp on the archive. Install the database server and client tools: Start the database: Increase the allowed packets to accommodate the size of our database backup: Extract the database and database configuration from the archive: Restore the database backup: Extract a temporary version of the root configuration file: Get the old root database password: Reset the root database password: Copy the root configuration file from the temporary location: Get a list of old user permissions: Remove the old user permissions for each host listed. For example: Perform this for all users accessing through the host IP and any host (" % "). Note The IP address in the HOST parameter is the undercloud's IP address in the control plane. Stop the database: Create the stack user: Set a password for the user: Disable password requirements when using sudo : Restore the stack user home directory: Install the python3-policycoreutils package: Restore the glance data: Restore the swift data: If using SSL in the undercloud, refresh the CA certificates: Switch to the stack user: Install the python3-tripleoclient package: Run the undercloud installation command. Ensure that you run it in the stack user's home directory: When the install completes, the undercloud automatically restores its connection to the overcloud. The nodes continue to poll OpenStack Orchestration (heat) for pending tasks.

Commands:
subscription-manager register
subscription-manager attach --pool=Valid-Pool-Number-123456
subscription-manager repos --disable=* subscription-manager repos --enable=rhel-8-for-x86_64-baseos-eus-rpms --enable=rhel-8-for-x86_64-appstream-eus-rpms --enable=rhel-8-for-x86_64-highavailability-eus-rpms --enable=ansible-2.8-for-rhel-8-x86_64-rpms --enable=openstack-16-for-rhel-8-x86_64-rpms --enable=fast-datapath-for-rhel-8-x86_64-rpms
dnf update -y reboot
dnf install -y chrony systemctl start chronyd systemctl enable chronyd
dnf install -y mariadb mariadb-server
systemctl start mariadb
mysql -uroot -e"set global max_allowed_packet = 1073741824;"
tar -xvC / -f undercloud-backup-USDTIMESTAMP.tar var/lib/config-data/mysql/etc/my.cnf.d/galera.cnf tar -xvC / -f undercloud-backup-USDTIMESTAMP.tar root/undercloud-all-databases.sql
mysql -u root < /root/undercloud-all-databases.sql
tar -xvf undercloud-backup-USDTIMESTAMP.tar root/.my.cnf
OLDPASSWORD=USD(sudo cat root/.my.cnf | grep -m1 password | cut -d'=' -f2 | tr -d "'")
mysqladmin -u root password "USDOLDPASSWORD"
mv root/.my.cnf . rmdir root
mysql -e 'select host, user, password from mysql.user;'
HOST="192.0.2.1" USERS=USD(mysql -Nse "select user from mysql.user WHERE user != \"root\" and host = \"USDHOST\";" | uniq | xargs) for USER in USDUSERS ; do mysql -e "drop user \"USDUSER\"@\"USDHOST\"" || true ;done mysql -e 'flush privileges'
systemctl stop mariadb
useradd stack
passwd stack
echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack chmod 0440 /etc/sudoers.d/stack
tar -xvC / -f undercloud-backup-USDTIMESTAMP.tar home/stack
dnf -y install python3-policycoreutils
tar --xattrs -xvC / -f undercloud-backup-USDTIMESTAMP.tar var/lib/glance
tar --xattrs -xvC / -f undercloud-backup-USDTIMESTAMP.tar srv/node
tar -xvC / -f undercloud-backup-USDTIMESTAMP.tar etc/pki/instack-certs/undercloud.pem tar -xvC / -f undercloud-backup-USDTIMESTAMP.tar etc/pki/ca-trust/source/anchors/* restorecon -R /etc/pki semanage fcontext -a -t etc_t "/etc/pki/instack-certs(/.*)?" restorecon -R /etc/pki/instack-certs update-ca-trust extract
su - stack [stack@director ~]USD
sudo dnf install -y python3-tripleoclient ceph-ansible
[stack@director ~]USD openstack undercloud install