Ce contenu n'est pas disponible dans la langue sélectionnée.
Backing up and restoring the undercloud and control plane nodes
Creating and restoring backups of the undercloud and the overcloud control plane nodes
Abstract
Making open source more inclusive Copier lienLien copié sur presse-papiers!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Providing feedback on Red Hat documentation Copier lienLien copié sur presse-papiers!
We appreciate your input on our documentation. Tell us how we can make it better.
Using the Direct Documentation Feedback (DDF) function
Use the Add Feedback DDF function for direct comments on specific sentences, paragraphs, or code blocks.
- View the documentation in the Multi-page HTML format.
- Ensure that you see the Feedback button in the upper right corner of the document.
- Highlight the part of text that you want to comment on.
- Click Add Feedback.
- Complete the Add Feedback field with your comments.
- Optional: Add your email address so that the documentation team can contact you for clarification on your issue.
- Click Submit.
Chapter 1. Backing up the undercloud node Copier lienLien copié sur presse-papiers!
To back up the undercloud node, you configure the backup node, install the Relax-and-Recover tool on the undercloud node, and create the backup image. You can create backups as a part of your regular environment maintenance.
In addition, you must back up the undercloud node before performing updates or upgrades. You can use the backups to restore the undercloud node to its previous state if an error occurs during an update or upgrade.
1.1. Supported backup formats and protocols Copier lienLien copié sur presse-papiers!
The undercloud and backup and restore process uses the open-source tool Relax-and-Recover (ReaR) to create and restore bootable backup images. ReaR is written in Bash and supports multiple image formats and multiple transport protocols.
The following list shows the backup formats and protocols that Red Hat OpenStack Platform supports.
- Bootable media formats
- ISO
- File transport protocols
- SFTP
- NFS
1.2. Installing and configuring an NFS server on the backup node Copier lienLien copié sur presse-papiers!
You can install and configure a new NFS server to store the backup file. To install and configure an NFS server on the backup node, create an inventory file, set up an SSH key, and run the openstack undercloud backup
command with the NFS server options.
- If you previously installed and configured an NFS or SFTP server, you do not need to complete this procedure. You enter the server information when you set up ReaR on the node that you want to back up.
-
By default, the Relax and Recover (ReaR) configuration assumes that the IP address of the NFS server is
192.168.24.1
. If your NFS server has a different IP address, add the parametertripleo_backup_and_restore_server
to the setup ReaR command.
Procedure
On the undercloud node, source the undercloud credentials:
source stackrc
[stack@undercloud ~]$ source stackrc (undercloud) [stack@undercloud ~]$
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create an inventory file for the backup node and replace the
<ip_address>
and<user>
with the values that apply to your environment:cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
(undercloud) [stack@undercloud ~]$ cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create the following Ansible playbook and replace
<backup_node>
with the host name of the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the public SSH key from the undercloud node to the backup node.
ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
(undercloud) [stack@undercloud ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<backup_node>
with the path and name of the backup node.On the undercloud node, enter the following
ansible-playbook
commands to configure the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Installing ReaR on the undercloud node Copier lienLien copié sur presse-papiers!
Before you create a backup of the undercloud node, install and configure Relax and Recover (ReaR) on the undercloud.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 1.2, “Installing and configuring an NFS server on the backup node”.
Procedure
On the undercloud node, source the undercloud credentials and use the
tripleo-ansible-inventory
command to generate a static inventory file that contains hosts and variables for all the overcloud nodes:source stackrc
[stack@undercloud ~]$ source stackrc (undercloud) [stack@undercloud ~]$ tripleo-ansible-inventory \ --ansible_ssh_user heat-admin \ --static-yaml-inventory /home/stack/tripleo-inventory.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use a custom stack name, add the
--stack <stack_name>
option to thetripleo-ansible-inventory
command.On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Choose one of the following options:
If you use NFS, enter the following Ansible command to install ReaR on the undercloud node:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use SFTP, enter the following Ansible command to install ReaR on the undercloud node:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If your system uses the UEFI boot loader, perform the following steps on the undercloud node:
Install the following tools:
sudo dnf install dosfstools efibootmgr
$ sudo dnf install dosfstools efibootmgr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Enable UEFI backup in the ReaR configuration file located in
/etc/rear/local.conf
by replacing theUSING_UEFI_BOOTLOADER
parameter value0
with the value1
.
1.4. Configuring Open vSwitch (OVS) interfaces for backup Copier lienLien copié sur presse-papiers!
If you use an Open vSwitch (OVS) bridge in your environment, you must manually configure the OVS interfaces before you create a backup of the undercloud or control plane nodes. The restoration process uses this information to restore the network interfaces.
Procedure
In the
/etc/rear/local.conf
file, add theNETWORKING_PREPARATION_COMMANDS
parameter in the following format:NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<command_1>
and<command_2>
with commands that configure the network interface names or IP addresses. For example, you can add theip link add br-ctlplane type bridge
command to configure the control plane bridge name or add theip link set eth0 up
command to set the name of the interface. You can add more commands to the parameter based on your network configuration.
1.5. Creating a backup of the undercloud node Copier lienLien copié sur presse-papiers!
To create a backup of the undercloud node, use the backup-and-restore
Ansible role. You can then use the backup to restore the undercloud node to its previous state in case the node becomes corrupted or inaccessible. The backup of the undercloud node includes the backup of the database that runs on the undercloud node.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 1.2, “Installing and configuring an NFS server on the backup node”.
- You have installed ReaR on the undercloud node. For more information, see Section 1.3, “Installing ReaR on the undercloud node”.
- If you use an OVS bridge for your network interfaces, you have configured the OVS interfaces. For more information, see Section 1.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
-
Log in to the undercloud as the
stack
user. Retrieve the MySQL root password:
PASSWORD=$(sudo /bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password)
[stack@undercloud ~]$ PASSWORD=$(sudo /bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a database backup of the undercloud node:
sudo podman exec mysql bash -c "mysqldump -uroot -p$PASSWORD --opt --all-databases" | sudo tee /root/undercloud-all-databases.sql
[stack@undercloud ~]$ sudo podman exec mysql bash -c "mysqldump -uroot -p$PASSWORD --opt --all-databases" | sudo tee /root/undercloud-all-databases.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Source the undercloud credentials:
source stackrc
[stack@undercloud ~]$ source stackrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create a backup of the undercloud node, enter the following
ansible-playbook
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 2. Backing up the control plane nodes Copier lienLien copié sur presse-papiers!
To back up the control plane nodes, you configure the backup node, install the Relax-and-Recover tool on the control plane nodes, and create the backup image. You can create backups as a part of your regular environment maintenance.
You must back up the control plane nodes before performing updates or upgrades. You can use the backups to restore the control plane nodes to their previous state if an error occurs during an update or upgrade. You can also create backups as a part of your regular environment maintenance.
2.1. Supported backup formats and protocols Copier lienLien copié sur presse-papiers!
The undercloud and backup and restore process uses the open-source tool Relax-and-Recover (ReaR) to create and restore bootable backup images. ReaR is written in Bash and supports multiple image formats and multiple transport protocols.
The following list shows the backup formats and protocols that Red Hat OpenStack Platform supports.
- Bootable media formats
- ISO
- File transport protocols
- SFTP
- NFS
2.2. Installing and configuring an NFS server on the backup node Copier lienLien copié sur presse-papiers!
You can install and configure a new NFS server to store the backup file. To install and configure an NFS server on the backup node, create an inventory file, set up an SSH key, and run the openstack undercloud backup
command with the NFS server options.
- If you previously installed and configured an NFS or SFTP server, you do not need to complete this procedure. You enter the server information when you set up ReaR on the node that you want to back up.
-
By default, the Relax and Recover (ReaR) configuration assumes that the IP address of the NFS server is
192.168.24.1
. If your NFS server has a different IP address, add the parametertripleo_backup_and_restore_server
to the setup ReaR command.
Procedure
On the undercloud node, source the undercloud credentials:
source stackrc
[stack@undercloud ~]$ source stackrc (undercloud) [stack@undercloud ~]$
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create an inventory file for the backup node and replace the
<ip_address>
and<user>
with the values that apply to your environment:cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
(undercloud) [stack@undercloud ~]$ cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create the following Ansible playbook and replace
<backup_node>
with the host name of the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the public SSH key from the undercloud node to the backup node.
ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
(undercloud) [stack@undercloud ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<backup_node>
with the path and name of the backup node.On the undercloud node, enter the following
ansible-playbook
commands to configure the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Installing ReaR on the control plane nodes Copier lienLien copié sur presse-papiers!
Before you create a backup of the control plane nodes, install and configure Relax and Recover (ReaR) on each of the control plane nodes.
Due to a known issue, the ReaR backup of overcloud nodes continues even if a Controller node is down. Ensure that all your Controller nodes are running before you run the ReaR backup. A fix is planned for a later Red Hat OpenStack Platform (RHOSP) release. For more information, see BZ#2077335 - Back up of the overcloud ctlplane keeps going even if one controller is unreachable.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 2.2, “Installing and configuring an NFS server on the backup node”.
Procedure
On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you deployed the control plane nodes with composable roles, replace the host type
Controller
with the types of nodes in your control plane. For example, if you deployed the database, messaging, and networking on separate nodes, enterControllerOpenstack,Database,Messaging,Networker
.Choose one of the following options:
If you use NFS and the IP address of the NFS server is the default value
192.168.24.1
, on the undercloud node, enter the following Ansible command to install ReaR on the control plane nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use SFTP and the IP address of the NFS server is not the default value
192.168.24.1
, enter the following Ansible command to install ReaR on the control plane nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<nfs_ip>
with the IP address of your NFS server.If you use SFTP, enter the following Ansible command do install ReaR on the control plane nodes:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If your system uses the UEFI boot loader, perform the following steps on the control plane nodes:
Install the following tools:
sudo dnf install dosfstools efibootmgr
$ sudo dnf install dosfstools efibootmgr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Enable UEFI backup in the ReaR configuration file located in
/etc/rear/local.conf
by replacing theUSING_UEFI_BOOTLOADER
parameter value0
with the value1
.
2.4. Configuring Open vSwitch (OVS) interfaces for backup Copier lienLien copié sur presse-papiers!
If you use an Open vSwitch (OVS) bridge in your environment, you must manually configure the OVS interfaces before you create a backup of the undercloud or control plane nodes. The restoration process uses this information to restore the network interfaces.
Procedure
In the
/etc/rear/local.conf
file, add theNETWORKING_PREPARATION_COMMANDS
parameter in the following format:NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<command_1>
and<command_2>
with commands that configure the network interface names or IP addresses. For example, you can add theip link add br-ctlplane type bridge
command to configure the control plane bridge name or add theip link set eth0 up
command to set the name of the interface. You can add more commands to the parameter based on your network configuration.
2.5. Creating a backup of the control plane nodes Copier lienLien copié sur presse-papiers!
To create a backup of the control plane nodes, use the backup-and-restore
Ansible role. You can then use the backup to restore the control plane nodes to their previous state in case the nodes become corrupted or inaccessible. The backup of the control plane nodes includes the backup of the database that runs on the control plane nodes.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 2.2, “Installing and configuring an NFS server on the backup node”.
- You have installed ReaR on the control plane nodes. For more information, see Section 2.3, “Installing ReaR on the control plane nodes”.
- If you use an OVS bridge for your network interfaces, you have configured the OVS interfaces. For more information, see Section 2.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
On each control plane node, back up the
config-drive
partition of each node as theroot
user:dd if=<config_drive_partition> of=/mnt/config-drive
[root@controller-x ~]$ dd if=<config_drive_partition> of=/mnt/config-drive
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, enter the following
ansible-playbook
command to create a backup of the control plane nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.6. Scheduling control plane node backups with cron Copier lienLien copié sur presse-papiers!
This feature is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. It should only be used for testing, and should not be deployed in a production environment. For more information about Technology Preview features, see Scope of Coverage Details.
You can configure a cron job to create backups of the control plane nodes with ReaR using the Ansible backup-and-restore
role. You can view the logs in the /var/log/rear-cron
directory.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 1.2, “Installing and configuring an NFS server on the backup node”.
- You have installed ReaR on the undercloud and control plane nodes. For more information, see Section 2.3, “Installing ReaR on the control plane nodes”.
- You have sufficient available disk space at your backup location to store the backup.
Procedure
On the undercloud node, enter the following command to create the backup script:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set executable privileges for the
/home/stack/execute-rear-cron.sh
script:chmod 755 /home/stack/execute-rear-cron.sh
[stack@undercloud ~]$ chmod 755 /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the crontab file with the
crontab -e
command and use an editor of your choice to add the following cron job. Ensure you save the changes to the file:$ crontab -e
[stack@undercloud ~]# $ crontab -e #adding the following line 0 0 * * * /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
/home/stack/execute-rear-cron.sh
script is scheduled to be executed by the stack user at midnight.To verify that the cron job is scheduled, enter the following command:
crontab -l
[stack@undercloud ~]$ crontab -l
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command output displays the scheduled cron jobs:
0 0 * * * /home/stack/execute-rear-cron.sh
0 0 * * * /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 3. Backing up control plane nodes that use composable roles Copier lienLien copié sur presse-papiers!
If you deployed the control plane with composable roles, also known as custom roles, configure the backup process to capture each type of node based on your composable role configuration. To back up the control plane nodes, you configure the backup node, install the Relax-and-Recover tool on the control plane nodes, and create the backup image.
You must back up the control plane nodes before performing updates or upgrades. You can use the backups to restore the control plane nodes to their previous state if an error occurs during an update or upgrade. You can also create backups as a part of your regular environment maintenance.
3.1. Supported backup formats and protocols Copier lienLien copié sur presse-papiers!
The undercloud and backup and restore process uses the open-source tool Relax-and-Recover (ReaR) to create and restore bootable backup images. ReaR is written in Bash and supports multiple image formats and multiple transport protocols.
The following list shows the backup formats and protocols that Red Hat OpenStack Platform supports.
- Bootable media formats
- ISO
- File transport protocols
- SFTP
- NFS
3.2. Installing and configuring an NFS server on the backup node Copier lienLien copié sur presse-papiers!
You can install and configure a new NFS server to store the backup file. To install and configure an NFS server on the backup node, create an inventory file, set up an SSH key, and run the openstack undercloud backup
command with the NFS server options.
- If you previously installed and configured an NFS or SFTP server, you do not need to complete this procedure. You enter the server information when you set up ReaR on the node that you want to back up.
-
By default, the Relax and Recover (ReaR) configuration assumes that the IP address of the NFS server is
192.168.24.1
. If your NFS server has a different IP address, add the parametertripleo_backup_and_restore_server
to the setup ReaR command.
Procedure
On the undercloud node, source the undercloud credentials:
source stackrc
[stack@undercloud ~]$ source stackrc (undercloud) [stack@undercloud ~]$
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create an inventory file for the backup node and replace the
<ip_address>
and<user>
with the values that apply to your environment:cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
(undercloud) [stack@undercloud ~]$ cat <<'EOF'> ~/nfs-inventory.yaml [BackupNode] <backup_node> ansible_host=<ip_address> ansible_user=<user> EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, create the following Ansible playbook and replace
<backup_node>
with the host name of the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the public SSH key from the undercloud node to the backup node.
ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
(undercloud) [stack@undercloud ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub <backup_node>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<backup_node>
with the path and name of the backup node.On the undercloud node, enter the following
ansible-playbook
commands to configure the backup node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Installing ReaR on the control plane nodes Copier lienLien copié sur presse-papiers!
Before you create a backup of the control plane nodes, install and configure Relax and Recover (ReaR) on each of the control plane nodes.
Due to a known issue, the ReaR backup of overcloud nodes continues even if a Controller node is down. Ensure that all your Controller nodes are running before you run the ReaR backup. A fix is planned for a later Red Hat OpenStack Platform (RHOSP) release. For more information, see BZ#2077335 - Back up of the overcloud ctlplane keeps going even if one controller is unreachable.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 3.2, “Installing and configuring an NFS server on the backup node”.
Procedure
On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you deployed the control plane nodes with composable roles, replace the host type
Controller
with the types of nodes in your control plane. For example, if you deployed the database, messaging, and networking on separate nodes, enterControllerOpenstack,Database,Messaging,Networker
.Choose one of the following options:
If you use NFS and the IP address of the NFS server is the default value
192.168.24.1
, on the undercloud node, enter the following Ansible command to install ReaR on the control plane nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use SFTP and the IP address of the NFS server is not the default value
192.168.24.1
, enter the following Ansible command to install ReaR on the control plane nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<nfs_ip>
with the IP address of your NFS server.If you use SFTP, enter the following Ansible command do install ReaR on the control plane nodes:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If your system uses the UEFI boot loader, perform the following steps on the control plane nodes:
Install the following tools:
sudo dnf install dosfstools efibootmgr
$ sudo dnf install dosfstools efibootmgr
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Enable UEFI backup in the ReaR configuration file located in
/etc/rear/local.conf
by replacing theUSING_UEFI_BOOTLOADER
parameter value0
with the value1
.
3.4. Configuring Open vSwitch (OVS) interfaces for backup Copier lienLien copié sur presse-papiers!
If you use an Open vSwitch (OVS) bridge in your environment, you must manually configure the OVS interfaces before you create a backup of the undercloud or control plane nodes. The restoration process uses this information to restore the network interfaces.
Procedure
In the
/etc/rear/local.conf
file, add theNETWORKING_PREPARATION_COMMANDS
parameter in the following format:NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
NETWORKING_PREPARATION_COMMANDS=('<command_1>' '<command_2>' ...')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<command_1>
and<command_2>
with commands that configure the network interface names or IP addresses. For example, you can add theip link add br-ctlplane type bridge
command to configure the control plane bridge name or add theip link set eth0 up
command to set the name of the interface. You can add more commands to the parameter based on your network configuration.
3.5. Creating a backup of control plane nodes that use composable roles Copier lienLien copié sur presse-papiers!
To create a backup of control plane nodes that use composable roles, use the backup-and-restore
Ansible role. You can then use the backup to restore the control plane nodes to their previous state in case the nodes become corrupted or inaccessible. The backup of the control plane nodes includes the backup of the database that runs on the control plane nodes.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 3.2, “Installing and configuring an NFS server on the backup node”.
- You have installed ReaR on the control plane nodes. For more information, see Section 3.3, “Installing ReaR on the control plane nodes”.
- If you use an OVS bridge for your network interfaces, you have configured the OVS interfaces. For more information, see Section 3.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
On each Controller node, back up the
config-drive
partition of each node:mkdir /mnt/config-drive dd if=<config_drive_partition> of=/mnt/config-drive
[heat-admin@controller-x ~]$ mkdir /mnt/config-drive [heat-admin@controller-x ~]$ dd if=<config_drive_partition> of=/mnt/config-drive
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou only need to perform this step on the Controller nodes.
On the undercloud node, create the following Ansible playbook:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the undercloud node, enter the following
ansible-playbook
command to create a backup of the control plane nodes:ImportantDo not operate the stack. When you stop the pacemaker cluster and the containers, this results in the temporary interruption of control plane services to Compute nodes. There is also disruption to network connectivity, Ceph, and the NFS or SFTP data plane service. You cannot create instances, migrate instances, authenticate requests, or monitor the health of the cluster until the pacemaker cluster and the containers return to service following the final step of this procedure.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.6. Scheduling control plane node backups with cron Copier lienLien copié sur presse-papiers!
This feature is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. It should only be used for testing, and should not be deployed in a production environment. For more information about Technology Preview features, see Scope of Coverage Details.
You can configure a cron job to create backups of the control plane nodes with ReaR using the Ansible backup-and-restore
role. You can view the logs in the /var/log/rear-cron
directory.
Prerequisites
- You have an NFS or SFTP server installed and configured on the backup node. For more information about creating a new NFS server, see Section 1.2, “Installing and configuring an NFS server on the backup node”.
- You have installed ReaR on the undercloud and control plane nodes. For more information, see Section 2.3, “Installing ReaR on the control plane nodes”.
- You have sufficient available disk space at your backup location to store the backup.
Procedure
On the undercloud node, enter the following command to create the backup script:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set executable privileges for the
/home/stack/execute-rear-cron.sh
script:chmod 755 /home/stack/execute-rear-cron.sh
[stack@undercloud ~]$ chmod 755 /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the crontab file with the
crontab -e
command and use an editor of your choice to add the following cron job. Ensure you save the changes to the file:$ crontab -e
[stack@undercloud ~]# $ crontab -e #adding the following line 0 0 * * * /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
/home/stack/execute-rear-cron.sh
script is scheduled to be executed by the stack user at midnight.To verify that the cron job is scheduled, enter the following command:
crontab -l
[stack@undercloud ~]$ crontab -l
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command output displays the scheduled cron jobs:
0 0 * * * /home/stack/execute-rear-cron.sh
0 0 * * * /home/stack/execute-rear-cron.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 4. Restoring the undercloud and control plane nodes Copier lienLien copié sur presse-papiers!
If your undercloud or control plane nodes become corrupted or if an error occurs during an update or upgrade, you can restore the undercloud or overcloud control plane nodes from a backup to their previous state. If the restore process fails to automatically restore the Galera cluster or nodes with colocated Ceph monitors, you can restore these components manually.
4.1. Preparing a control plane with colocated Ceph monitors for the restore process Copier lienLien copié sur presse-papiers!
Before you restore a control plane with colocated Ceph monitors, prepare your environment by creating a script that mounts the Ceph monitor backup file to the node file system and another script that ReaR uses to locate the backup file.
If you cannot back up the /var/lib/ceph
directory, you must contact the Red Hat Technical Support team to rebuild the ceph-mon
index. For more information, see Red Hat Technical Support Team.
Prerequisites
- You have created a backup of the undercloud node. For more information, see Section 1.5, “Creating a backup of the undercloud node”.
- You have created a backup of the control plane nodes. For more information, see Section 2.5, “Creating a backup of the control plane nodes”.
- You have access to the backup node.
-
If you use an OVS bridge for your network interfaces, you have access to the network configuration information that you set in the
NETWORKING_PREPARATION_COMMANDS
parameter. For more information, see see Section 1.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
On each node that you want to restore, create the script
/usr/share/rear/setup/default/011_backup_ceph.sh
and add the following content:mount -t <file_type> <device_disk> /mnt/local cd /mnt/local [ -d "var/lib/ceph" ] && tar cvfz /tmp/ceph.tar.gz var/lib/ceph --xattrs --xattrs-include='.' --acls cd / umount <device_disk>
mount -t <file_type> <device_disk> /mnt/local cd /mnt/local [ -d "var/lib/ceph" ] && tar cvfz /tmp/ceph.tar.gz var/lib/ceph --xattrs --xattrs-include='.' --acls cd / umount <device_disk>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<file_type>
and<device_disk>
with the type and location of the backup file. Normally, the file type isxfs
and the location is/dev/vda2
.On the same node, create the script
/usr/share/rear/wrapup/default/501_restore_ceph.sh
and add the following content:if [ -f "/tmp/ceph.tar.gz" ]; then rm -rf /mnt/local/var/lib/ceph/* tar xvC /mnt/local -f /tmp/ceph.tar.gz var/lib/ceph --xattrs --xattrs-include='.' fi
if [ -f "/tmp/ceph.tar.gz" ]; then rm -rf /mnt/local/var/lib/ceph/* tar xvC /mnt/local -f /tmp/ceph.tar.gz var/lib/ceph --xattrs --xattrs-include='.' fi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Restoring the undercloud node Copier lienLien copié sur presse-papiers!
You can restore the undercloud node to its previous state using the backup ISO image that you created using ReaR. You can find the backup ISO images on the backup node. Burn the bootable ISO image to a DVD or download it to the undercloud node through Integrated Lights-Out (iLO) remote access.
Prerequisites
- You have created a backup of the undercloud node. For more information, see Section 2.5, “Creating a backup of the control plane nodes”.
- You have access to the backup node.
-
If you use an OVS bridge for your network interfaces, you have access to the network configuration information that you set in the
NETWORKING_PREPARATION_COMMANDS
parameter. For more information, see see Section 1.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
- Power off the undercloud node. Ensure that the undercloud node is powered off completely before you proceed.
- Boot the undercloud node with the backup ISO image.
When the
Relax-and-Recover
boot menu displays, selectRecover <undercloud_node>
. Replace<undercloud_node>
with the name of your undercloud node.NoteIf your system uses UEFI, select the
Relax-and-Recover (no Secure Boot)
option.Log in as the
root
user and restore the node:The following message displays:
Welcome to Relax-and-Recover. Run "rear recover" to restore your system! RESCUE <undercloud_node>:~ # rear recover
Welcome to Relax-and-Recover. Run "rear recover" to restore your system! RESCUE <undercloud_node>:~ # rear recover
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When the undercloud node restoration process completes, the console displays the following message:
Finished recovering your system Exiting rear recover Running exit tasks
Finished recovering your system Exiting rear recover Running exit tasks
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Power off the node:
RESCUE <undercloud_node>:~ # poweroff
RESCUE <undercloud_node>:~ # poweroff
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On boot up, the node resumes its previous state.
4.3. Restoring the control plane nodes Copier lienLien copié sur presse-papiers!
If an error occurs during an update or upgrade, you can restore the control plane nodes to their previous state using the backup ISO image that you have created using ReaR. To restore the control plane, you must restore all control plane nodes to ensure state consistency.
You can find the backup ISO images on the backup node. Burn the bootable ISO image to a DVD or download it to the undercloud node through Integrated Lights-Out (iLO) remote access.
Red Hat supports backups of Red Hat OpenStack Platform with native SDNs, such as Open vSwitch (OVS) and the default Open Virtual Network (OVN). For information about third-party SDNs, refer to the third-party SDN documentation.
Prerequisites
Choose one of the following options:
- You have created a backup of the control plane nodes without composable roles. For more information, see Section 2.5, “Creating a backup of the control plane nodes”.
- You have created a backup of control plane nodes that use composable roles. For more information, see Section 3.5, “Creating a backup of control plane nodes that use composable roles”.
- You have access to the backup node.
-
If you use an OVS bridge for your network interfaces, you have access to the network configuration information that you set in the
NETWORKING_PREPARATION_COMMANDS
parameter. For more information, see see Section 2.4, “Configuring Open vSwitch (OVS) interfaces for backup”.
Procedure
- Power off each control plane node. Ensure that the control plane nodes are powered off completely before you proceed.
- Boot each control plane node with the corresponding backup ISO image.
When the
Relax-and-Recover
boot menu displays, on each control plane node, selectRecover <control_plane_node>
. Replace<control_plane_node>
with the name of the corresponding control plane node.NoteIf your system uses UEFI, select the
Relax-and-Recover (no Secure Boot)
option.On each control plane node, log in as the
root
user and restore the node:The following message displays:
Welcome to Relax-and-Recover. Run "rear recover" to restore your system! RESCUE <control_plane_node>:~ # rear recover
Welcome to Relax-and-Recover. Run "rear recover" to restore your system! RESCUE <control_plane_node>:~ # rear recover
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When the control plane node restoration process completes, the console displays the following message:
Finished recovering your system Exiting rear recover Running exit tasks
Finished recovering your system Exiting rear recover Running exit tasks
Copy to Clipboard Copied! Toggle word wrap Toggle overflow When the command line console is available, restore the
config-drive
partition of each control plane node:once completed, restore the config-drive partition (which is ISO9660)
# once completed, restore the config-drive partition (which is ISO9660) RESCUE <control_plane_node>:~ $ dd if=/mnt/local/mnt/config-drive of=<config_drive_partition>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you deployed a control plane with composable roles, perform this step only on the Controller nodes.
Power off the node:
RESCUE <control_plane_node>:~ # poweroff
RESCUE <control_plane_node>:~ # poweroff
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the boot sequence to the normal boot device. On boot up, the node resumes its previous state.
To ensure that the services are running correctly, check the status of pacemaker. Log in to a Controller node as the
root
user and enter the following command:pcs status
# pcs status
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To view the status of the overcloud, use the OpenStack Integration Test Suite (tempest). For more information, see Validating your OpenStack cloud with the Integration Test Suite (tempest).
Troubleshooting
-
Clear resource alarms that are displayed by
pcs status
by running the following command:
pcs resource clean
# pcs resource clean
-
Clear STONITH fencing action errors that are displayed by
pcs status
by running the following commands:
pcs resource clean pcs stonith history cleanup
# pcs resource clean
# pcs stonith history cleanup
4.4. Restoring the Galera cluster manually Copier lienLien copié sur presse-papiers!
If the Galera cluster does not restore as part of the restoration procedure, you must restore Galera manually.
In this procedure, you must perform some steps on one Controller node. Ensure that you perform these steps on the same Controller node as you go through the procedure.
Procedure
On
Controller-0
, retrieve the Galera cluster virtual IP:sudo hiera -c /etc/puppet/hiera.yaml mysql_vip
$ sudo hiera -c /etc/puppet/hiera.yaml mysql_vip
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the database connections through the virtual IP on all Controller nodes:
sudo iptables -I INPUT -p tcp --destination-port 3306 -d $MYSQL_VIP -j DROP
$ sudo iptables -I INPUT -p tcp --destination-port 3306 -d $MYSQL_VIP -j DROP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On
Controller-0
, retrieve the MySQL root password:sudo hiera -c /etc/puppet/hiera.yaml mysql::server::root_password
$ sudo hiera -c /etc/puppet/hiera.yaml mysql::server::root_password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On
Controller-0
, set the Galera resource tounmanaged
mode:sudo pcs resource unmanage galera-bundle
$ sudo pcs resource unmanage galera-bundle
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the MySQL containers on all Controller nodes:
sudo podman container stop $(sudo podman container ls --all --format "{{.Names}}" --filter=name=galera-bundle)
$ sudo podman container stop $(sudo podman container ls --all --format "{{.Names}}" --filter=name=galera-bundle)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the current directory on all Controller nodes:
sudo mv /var/lib/mysql /var/lib/mysql-save
$ sudo mv /var/lib/mysql /var/lib/mysql-save
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the new directory
/var/lib/mysq
on all Controller nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the MySQL containers on all Controller nodes:
sudo podman container start $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle)
$ sudo podman container start $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the MySQL database on all Controller nodes:
sudo podman exec -i $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql_install_db --datadir=/var/lib/mysql --user=mysql --log_error=/var/log/mysql/mysql_init.log"
$ sudo podman exec -i $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql_install_db --datadir=/var/lib/mysql --user=mysql --log_error=/var/log/mysql/mysql_init.log"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the database on all Controller nodes:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysqld_safe --skip-networking --wsrep-on=OFF --log-error=/var/log/mysql/mysql_safe.log" &
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysqld_safe --skip-networking --wsrep-on=OFF --log-error=/var/log/mysql/mysql_safe.log" &
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the
.my.cnf
Galera configuration file on all Controller nodes:sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mv /root/.my.cnf /root/.my.cnf.bck"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mv /root/.my.cnf /root/.my.cnf.bck"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reset the Galera root password on all Controller nodes:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -uroot -e'use mysql;update user set password=PASSWORD(\"$ROOTPASSWORD\")where User=\"root\";flush privileges;'"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -uroot -e'use mysql;update user set password=PASSWORD(\"$ROOTPASSWORD\")where User=\"root\";flush privileges;'"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the
.my.cnf
Galera configuration file inside the Galera container on all Controller nodes:sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mv /root/.my.cnf.bck /root/.my.cnf"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mv /root/.my.cnf.bck /root/.my.cnf"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On
Controller-0
, copy the backup database files to/var/lib/MySQL
:sudo cp $BACKUP_FILE /var/lib/mysql sudo cp $BACKUP_GRANT_FILE /var/lib/mysql
$ sudo cp $BACKUP_FILE /var/lib/mysql $ sudo cp $BACKUP_GRANT_FILE /var/lib/mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe path to these files is /home/heat-admin/.
On
Controller-0
, restore the MySQL database:sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -u root -p$ROOT_PASSWORD < \"/var/lib/mysql/$BACKUP_FILE\" " sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -u root -p$ROOT_PASSWORD < \"/var/lib/mysql/$BACKUP_GRANT_FILE\" "
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -u root -p$ROOT_PASSWORD < \"/var/lib/mysql/$BACKUP_FILE\" " $ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysql -u root -p$ROOT_PASSWORD < \"/var/lib/mysql/$BACKUP_GRANT_FILE\" "
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Shut down the databases on all Controller nodes:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysqladmin shutdown"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "mysqladmin shutdown"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On
Controller-0
, start the bootstrap node:sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle) \ /usr/bin/mysqld_safe --pid-file=/var/run/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql \ --log-error=/var/log/mysql/mysql_cluster.log --user=mysql --open-files-limit=16384 \ --wsrep-cluster-address=gcomm:// &
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle) \ /usr/bin/mysqld_safe --pid-file=/var/run/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql \ --log-error=/var/log/mysql/mysql_cluster.log --user=mysql --open-files-limit=16384 \ --wsrep-cluster-address=gcomm:// &
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verification: On Controller-0, check the status of the cluster:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "clustercheck"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "clustercheck"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the following message is displayed: “Galera cluster node is synced”, otherwise you must recreate the node.
On
Controller-0
, retrieve the cluster address from the configuration:sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "grep wsrep_cluster_address /etc/my.cnf.d/galera.cnf" | awk '{print $3}'
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "grep wsrep_cluster_address /etc/my.cnf.d/galera.cnf" | awk '{print $3}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On each of the remaining Controller nodes, start the database and validate the cluster:
Start the database:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) /usr/bin/mysqld_safe --pid-file=/var/run/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock \ --datadir=/var/lib/mysql --log-error=/var/log/mysql/mysql_cluster.log --user=mysql --open-files-limit=16384 \ --wsrep-cluster-address=$CLUSTER_ADDRESS &
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) /usr/bin/mysqld_safe --pid-file=/var/run/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock \ --datadir=/var/lib/mysql --log-error=/var/log/mysql/mysql_cluster.log --user=mysql --open-files-limit=16384 \ --wsrep-cluster-address=$CLUSTER_ADDRESS &
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the status of the MYSQL cluster:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "clustercheck"
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" \ --filter=name=galera-bundle) bash -c "clustercheck"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the following message is displayed: “Galera cluster node is synced”, otherwise you must recreate the node.
Stop the MySQL container on all Controller nodes:
sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle) \ /usr/bin/mysqladmin -u root shutdown
$ sudo podman exec $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle) \ /usr/bin/mysqladmin -u root shutdown
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On all Controller nodes, remove the following firewall rule to allow database connections through the virtual IP address:
sudo iptables -D INPUT -p tcp --destination-port 3306 -d $MYSQL_VIP -j DROP
$ sudo iptables -D INPUT -p tcp --destination-port 3306 -d $MYSQL_VIP -j DROP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the MySQL container on all Controller nodes:
sudo podman container restart $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle)
$ sudo podman container restart $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=galera-bundle)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the
clustercheck
container on all Controller nodes:sudo podman container restart $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=clustercheck)
$ sudo podman container restart $(sudo podman container ls --all --format "{{ .Names }}" --filter=name=clustercheck)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On
Controller-0
, set the Galera resource tomanaged
mode:sudo pcs resource manage galera-bundle
$ sudo pcs resource manage galera-bundle
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
To ensure that services are running correctly, check the status of pacemaker:
sudo pcs status
$ sudo pcs status
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To view the status of the overcloud, use the OpenStack Integration Test Suite (tempest). For more information, see Validating your OpenStack cloud with the Integration Test Suite (tempest).
If you suspect an issue with a particular node, check the state of the cluster with
clustercheck
:sudo podman exec clustercheck /usr/bin/clustercheck
$ sudo podman exec clustercheck /usr/bin/clustercheck
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.5. Restoring the undercloud node database manually Copier lienLien copié sur presse-papiers!
If the undercloud database does not restore as part of the undercloud restore process, you can restore the database manually. You can only restore the database if you previously created a standalone database backup.
Prerequisites
- You have created a backup of the undercloud database. For more information about backing up the undercloud database, see Section 1.5, “Creating a backup of the undercloud node”.
Procedure
-
Log in to the director undercloud node as the
root
user. Stop all tripleo services:
systemctl stop tripleo_*
[root@director ~]# systemctl stop tripleo_*
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that no containers are running on the server by entering the following command:
podman ps
[root@director ~]# podman ps
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If any containers are running, enter the following command to stop the containers:
podman stop <container_name>
[root@director ~]# podman stop <container_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a backup of the current
/var/lib/mysql
directory and then delete the directory:cp -a /var/lib/mysql /var/lib/mysql_bck rm -rf /var/lib/mysql
[root@director ~]# cp -a /var/lib/mysql /var/lib/mysql_bck [root@director ~]# rm -rf /var/lib/mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Recreate the database directory and set the SELinux attributes for the new directory:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a local tag for the
mariadb
image. Replace<image_id>
and<undercloud.ctlplane.example.com>
with the values applicable in your environment:podman images | grep mariadb
[root@director ~]# podman images | grep mariadb <undercloud.ctlplane.example.com>:8787/rh-osbs/rhosp16-openstack-mariadb 16.2_20210322.1 <image_id> 3 weeks ago 718 MB
Copy to Clipboard Copied! Toggle word wrap Toggle overflow podman tag <image_id> mariadb
[root@director ~]# podman tag <image_id> mariadb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow podman images | grep maria
[root@director ~]# podman images | grep maria localhost/mariadb latest <image_id> 3 weeks ago 718 MB <undercloud.ctlplane.example.com>:8787/rh-osbs/rhosp16-openstack-mariadb 16.2_20210322.1 <image_id> 3 weeks ago 718 MB
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Initialize the
/var/lib/mysql
directory with the container:podman run --net=host -v /var/lib/mysql:/var/lib/mysql localhost/mariadb mysql_install_db --datadir=/var/lib/mysql --user=mysql
[root@director ~]# podman run --net=host -v /var/lib/mysql:/var/lib/mysql localhost/mariadb mysql_install_db --datadir=/var/lib/mysql --user=mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the database backup file that you want to import to the database:
cp /root/undercloud-all-databases.sql /var/lib/mysql
[root@director ~]# cp /root/undercloud-all-databases.sql /var/lib/mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the database service to import the data:
podman run --net=host -dt -v /var/lib/mysql:/var/lib/mysql localhost/mariadb /usr/libexec/mysqld
[root@director ~]# podman run --net=host -dt -v /var/lib/mysql:/var/lib/mysql localhost/mariadb /usr/libexec/mysqld
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the data and configure the
max_allowed_packet
parameter:Log in to the container and configure it:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the container:
podman stop <container_id>
[root@director ~]# podman stop <container_id>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check that no containers are running:
podman ps
[root@director ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@director ~]#
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Restart all tripleo services:
systemctl start multi-user.target
[root@director ~]# systemctl start multi-user.target
Copy to Clipboard Copied! Toggle word wrap Toggle overflow