이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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

  1. Log into your undercloud as the root user.
  2. Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:

    [root@director ~]# subscription-manager register
    Copy to Clipboard Toggle word wrap
  3. Attach the Red Hat OpenStack Platform entitlement:

    [root@director ~]# subscription-manager attach --pool=Valid-Pool-Number-123456
    Copy to Clipboard Toggle word wrap
  4. Disable all default repositories, and then enable the required Red Hat Enterprise Linux repositories:

    [root@director ~]# subscription-manager repos --disable=*
    [root@director ~]# 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
    Copy to Clipboard Toggle word wrap
  5. Perform an update on your system to make sure you have the latest base system packages:

    [root@director ~]# dnf update -y
    [root@director ~]# reboot
    Copy to Clipboard Toggle word wrap
  6. Ensure the time on your undercloud is synchronized. For example:

    [root@director ~]# dnf install -y chrony
    [root@director ~]# systemctl start chronyd
    [root@director ~]# systemctl enable chronyd
    Copy to Clipboard Toggle word wrap
  7. Copy the undercloud backup archive to the undercloud’s root directory. The following steps use undercloud-backup-$TIMESTAMP.tar as the filename, where $TIMESTAMP is a Bash variable for the timestamp on the archive.
  8. Install the database server and client tools:

    [root@director ~]# dnf install -y mariadb mariadb-server
    Copy to Clipboard Toggle word wrap
  9. Start the database:

    [root@director ~]# systemctl start mariadb
    Copy to Clipboard Toggle word wrap
  10. Increase the allowed packets to accommodate the size of our database backup:

    [root@director ~]# mysql -uroot -e"set global max_allowed_packet = 1073741824;"
    Copy to Clipboard Toggle word wrap
  11. Extract the database and database configuration from the archive:

    [root@director ~]# tar -xvC / -f undercloud-backup-$TIMESTAMP.tar var/lib/config-data/mysql/etc/my.cnf.d/galera.cnf
    [root@director ~]# tar -xvC / -f undercloud-backup-$TIMESTAMP.tar root/undercloud-all-databases.sql
    Copy to Clipboard Toggle word wrap
  12. Restore the database backup:

    [root@director ~]# mysql -u root < /root/undercloud-all-databases.sql
    Copy to Clipboard Toggle word wrap
  13. Extract a temporary version of the root configuration file:

    [root@director ~]# tar -xvf undercloud-backup-$TIMESTAMP.tar root/.my.cnf
    Copy to Clipboard Toggle word wrap
  14. Get the old root database password:

    [root@director ~]# OLDPASSWORD=$(sudo cat root/.my.cnf | grep -m1 password | cut -d'=' -f2 | tr -d "'")
    Copy to Clipboard Toggle word wrap
  15. Reset the root database password:

    [root@director ~]# mysqladmin -u root password "$OLDPASSWORD"
    Copy to Clipboard Toggle word wrap
  16. Copy the root configuration file from the temporary location:

    [root@director ~]# mv root/.my.cnf .
    [root@director ~]# rmdir root
    Copy to Clipboard Toggle word wrap
  17. Get a list of old user permissions:

    [root@director ~]# mysql -e 'select host, user, password from mysql.user;'
    Copy to Clipboard Toggle word wrap
  18. Remove the old user permissions for each host listed. For example:

    [root@director ~]# HOST="192.0.2.1"
    [root@director ~]# USERS=$(mysql -Nse "select user from mysql.user WHERE user != \"root\" and host = \"$HOST\";" | uniq | xargs)
    [root@director ~]# for USER in $USERS ; do mysql -e "drop user \"$USER\"@\"$HOST\"" || true ;done
    [root@director ~]# mysql -e 'flush privileges'
    Copy to Clipboard Toggle word wrap

    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.

  1. Stop the database:

    [root@director ~]# systemctl stop mariadb
    Copy to Clipboard Toggle word wrap
  2. Create the stack user:

    [root@director ~]# useradd stack
    Copy to Clipboard Toggle word wrap
  3. Set a password for the user:

    [root@director ~]# passwd stack
    Copy to Clipboard Toggle word wrap
  4. Disable password requirements when using sudo:

    [root@director ~]# echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack
    [root@director ~]# chmod 0440 /etc/sudoers.d/stack
    Copy to Clipboard Toggle word wrap
  5. Restore the stack user home directory:

    # tar -xvC / -f undercloud-backup-$TIMESTAMP.tar home/stack
    Copy to Clipboard Toggle word wrap
  6. Install the python3-policycoreutils package:

    [root@director ~]# dnf -y install python3-policycoreutils
    Copy to Clipboard Toggle word wrap
  7. Restore the glance data:

    [root@director ~]# tar --xattrs -xvC / -f undercloud-backup-$TIMESTAMP.tar var/lib/glance
    Copy to Clipboard Toggle word wrap
  8. Restore the swift data:

    [root@director ~]# tar --xattrs -xvC / -f undercloud-backup-$TIMESTAMP.tar srv/node
    Copy to Clipboard Toggle word wrap
  9. If using SSL in the undercloud, refresh the CA certificates:

    [root@director ~]# tar -xvC / -f undercloud-backup-$TIMESTAMP.tar etc/pki/instack-certs/undercloud.pem
    [root@director ~]# tar -xvC / -f undercloud-backup-$TIMESTAMP.tar etc/pki/ca-trust/source/anchors/*
    [root@director ~]# restorecon -R /etc/pki
    [root@director ~]# semanage fcontext -a -t etc_t "/etc/pki/instack-certs(/.*)?"
    [root@director ~]# restorecon -R /etc/pki/instack-certs
    [root@director ~]# update-ca-trust extract
    Copy to Clipboard Toggle word wrap
  10. Switch to the stack user:

    [root@director ~]# su - stack
    [stack@director ~]$
    Copy to Clipboard Toggle word wrap
  11. Install the python3-tripleoclient package:

    $ sudo dnf install -y python3-tripleoclient ceph-ansible
    Copy to Clipboard Toggle word wrap
  12. Run the undercloud installation command. Ensure that you run it in the stack user’s home directory:

    [stack@director ~]$ openstack undercloud install
    Copy to Clipboard Toggle word wrap

When the install completes, the undercloud automatically restores its connection to the overcloud. The nodes continue to poll OpenStack Orchestration (heat) for pending tasks.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동