Reference: Migrating from CentOS to Rocky Linux
CentOS Linux reached end-of-life on June 30, 2024 and is no longer supported. If you are running CentOS Linux 7, migrate to Rocky Linux to continue receiving security updates, fixes, and new features. For more information, see What to know about CentOS Linux EOL.
Complete the following steps to migrate from a CentOS Linux virtual machine (VM) image to a Rocky Linux virtual machine image. This process maintains the full integrity of the database and all groups, settings, policies, and historical data. This process takes into account any Turbonomic licenses, secrets,network settings, and certificates. Other customizations must be manually ported.
If you need to migrate a secure client OVA from CentOS to Rocky Linux OVA, see this topic for more information.
Prerequisites
You must first upgrade Turbonomic to the version on which you will deploy Rocky Linux.
The migration requires two scripts - a backup script (xl-backup.sh
) and a
restore script (xl-restore.sh
) - which are located at
/opt/turbonomic/kubernetes/migration
. For CentOS-based installs, the scripts become
available after you upgrade Turbonomic.
As of Turbonomic
8.12.2, kubechangeip.sh
and kuberenewcerts.sh
are not included in Rocky Linux. These scripts will
be included in a future release.
Obtain the CentOS VM image network information
To set up Rocky Linux VM image so that it is identical to the CentOS Linux VM image, run the following commands on the CentOS Linux VM image to obtain the network information.
-
Hostname -
uname -n
-
IP address -
ifconfig eth0
-
Subnet mask -
ifconfig eth0
-
Gateway -
ip route
-
DNS Server (preferable DNS server and backup DNS server - separated by a space) -
cat/etc/resolv.conf
-
DNS domain -
cat /etc/resolv.conf
The output is similar to the following example:
-
Hostname -
xlhost
-
IP address -
10.16.173.8
-
Subnet mask -
255.255.254.0
-
Gateway -
10.16.172.0
-
DNS1/DNS2:
10.16.150.2 10.16.150.3
-
DNS domain -
demo.turbonomic.com
During the backup, you must set the VM hard disk size in vCenter. For most installations, setting
the size to 500 GB
is sufficient but there may be some customers who need more
space. To determine the size of your installation, run the following command:
df -h | grep turbo-var_lib_mysql
The output is similar to the following example:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/turbo-var_lib_mysql 800G 22G 779G 3% /var/lib/dbs
If the Used
value (in this example, 22G
) is larger than
500 GB
, contact Turbonomic Support.
Preparing the CentOS Linux virtual machine image for backup
The following process backs up the existing CentOS Linux VM image to a *.tar.xz
file on an attached drive (for example, backup-2024-05-06.tar.xz
). The drive can
then be detached from the origin VM and reattached to the destination VM. This process assumes that
you have vCenter access to complete the necessary actions.
-
Add the drive to the virtual machine for the backup destination.
-
In vCenter, right-click on your origin virtual machine and select Edit Settings.
-
Click Add New Device and select Hard Disk from the menu.
-
Expand New Hard Disk and set the size to
500 GB
(or the value provided by Turbonomic Support) and set Disk Provisioning toThin Provision
to save on non-used space for your host. Configure other options based on your environment, then click OK. -
The Total hard disks field increases in number to reflect that you added a new hard disk. Select the Total hard disks value to view the attached disks.
-
Expand the new hard disk to obtain the name of the Disk File.
Save the name and path to use in the restoration process.
-
-
Mount the drive and set drive ownership.
You must have both an administrator (or similar) account in Turbonomic and root access to the virtual machine that uses an SSH terminal.
-
Open an SSH terminal session to the existing CentOS VM image.
Log in with the System Administrator that you set up when you installed Turbonomic.
-
Create the
/opt/backup
directory, if it does not already exist. This directory is used as the mounted directory for your backup.mkdir /opt/backup
-
Scan for the newly added drive to ensure that it is present.
sudo su -
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
ls /dev/sdc
-
Configure the disk partitions by using the following command and commonly-used answers to the follow-up prompts.
fdisk /dev/sdc
n
p
<press enter>
<press enter>
w
-
Create a disk partition on the newly added drive.
mkfs.ext4 /dev/sdc1
-
Mount the drive that was attached in vCenter to the
/opt/backup
directory you created.sudo mount /dev/sdc1 /opt/backup
-
Display the current mounts to your device to ensure that the drive is properly mounted to your VM.
You can add a
| grep
to the command to limit the results for easier readability.df -h | grep backup
-
Change the ownership of the
/opt/backup
directory to the Turbonomic user.This command requires root privileges.
sudo chown -R turbo.turbo /opt/backup
-
Exit
sudo
.exit
-
-
(Optional) Test file permissions.
-
Create a file in your backup directory.
touch /opt/backup/x
-
Check that the file
x
exists and belongs to the Turbonomic user.ls -al /opt/backup
-
Delete the test file.
rm /opt/backup/x
-
Run the backup script
-
Change directories to the location of the backup script.
cd /opt/turbonomic/kubernetes/migration
-
Make the script executable.
chmod +x xl-backup.sh
-
Run the backup script and output the progress in a log file.
First, run the Linux
screen
command, then run the backup script. For more information, see this website.screen -S xl-backup
./xl-backup.sh | tee -a /<path>/<filename>.log
If you want to watch the rolling log, open a new SSH session to the same terminal and run the command:
tail -f /<path>/<filename>.log
A file ending in
.tar.xz
(for example,backup-2024-05-06.tar.xz
) is written to the/opt/backup
directory. This backup file requires restoration on the new Turbonomic node. -
Unmount the drive.
-
Detach the drive from the source node.
sudo umount /opt/backup
-
Check to ensure that the drive is no longer mounted.
df -h | grep backup
-
-
Detach the drive in vCenter.
Switch back over to vCenter and detach the drive that was unmounted from the file system.
-
Right-click on your source virtual machine and select Edit Settings.
-
Select the value to the right of Total hard disks.
-
Hover over the rightmost side to display an X icon to detach the drive. Click the X icon.
-
Expand the new hard disk to view the various aspects of the drive.
Note:Ensure that the Disk File path and name are saved for later use. Do not select the option to delete the files from data store or else the drive and backup file contents are lost.
Click OK.
-
Power down the virtual machine once the drive is detached so that you can reuse the IP address on the destination virtual machine.
-
Rename the virtual machine in case that it needs to be powered back on.
You may need to power on the virtual machine if an issue occurs during the restoration process. If the virtual machine needs to be powered on, ensure to not power on the VM at the same time as the destination VM to avoid conflicting IP addresses.
-
Preparing the Rocky Linux VM Image
-
Create a new VM within vCenter using the Turbonomic image.
You should have this image ready locally to build the destination VM by using the same build as the source VM.
-
Open an SSH terminal session to the new Rocky Linux VM image.
-
Configure the Turbonomic user password.
-
Configure the
sudo
password.su -
-
Run
ipsetup
to configure the IP address.Set the IP address to the original source VM network details that you previously captured, similar to the following example.
-
Hostname:
xlhost
-
IP address:
10.16.173.8
-
Subnet mask:
255.255.254.0
-
Gateway:
10.16.172.0
-
DNS1/DNS2:
10.16.150.2 10.16.150.3
-
DNS domain:
demo.turbonomic.com
-
-
Restart the VM.
-
-
Change to the directory where the installer is stored.
cd /opt/local/bin
-
Run the Turbonomic installation.
t8cInstall.sh
-
Add the drive to the VM for the restoration destination.
-
In vCenter, right-click on your origin VM and select Edit Settings.
-
Click Add New Device and select Existing Hard Disk from the menu.
-
Navigate to and select the directory that contains the hard disk path that you previously saved, then click OK.
-
Verify that the path to the disk is correct, then click OK.
-
-
Mount the drive and set drive ownership.
You must have both an administrator (or similar) account in Turbonomic and root access to the virtual machine by using an SSH terminal.
-
Open an SSH terminal session to the Rocky VM image.
Log in with the System Administrator that you set up when you installed Turbonomic.
-
Create the
/opt/backup
directory, which is used as the mounted directory for your backup.mkdir /opt/backup
-
Scan for the newly added drive to ensure that it is present.
sudo su -
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
ls /dev/sdb
-
Mount the drive that was attached in vCenter to the
/opt/backup
directory you created.mount /dev/sdb1 /opt/backup
-
Display the current mounts to your device to ensure that the drive is properly mounted to your VM.
You can add a
| grep
to the command to limit the results for easier readability.df -h | grep backup
-
Change the ownership of the
/opt/backup
directory to the Turbonomic user.This command requires root privileges.
chown -R turbo.turbo /opt/backup
-
Exit
root
.exit
-
-
(Optional) Test file permissions.
-
Create a file in your backup directory.
touch /opt/backup/x
-
Check that the file
x
exists and belongs to the Turbonomic user.ls -al /opt/backup
-
Delete the test file.
rm /opt/backup/x
-
Run the restore script
-
Change directories to the location of the backup file.
cd /opt/turbonomic/kubernetes/migration
-
Make the script executable.
chmod +x xl-restore.sh
-
Run the restore script and output the progress a log file.
First, run the Linux
screen
command, then run the restore script.screen -S xl-restore
./xl-restore.sh | tee -a /<path>/<filename>.log
If you want to watch the rolling log, open a new SSH session to the same terminal and run the command:
tail -f /<path>/<filename>.log
A file ending in
*.tar.xz
(for example,restore-2024-05-06.tar.xz
) is written to the/opt/backup
directory. -
Verify that the restore worked as expected.
-
Check the status of the pods coming up.
watch kubectl get pods
Wait for the pods to come into a ready state.
-
Log in to the UI and validate targets, virtual machines, policies, historical data, and so on to ensure that the wanted data is present. The abstraction initially appears all green, which is normal behavior.
-
Let Turbonomic run through a few market cycles to catch up and start displaying actions and the health indicators.
-
-
(Optional) Unmount the drive.
-
Detach the drive from the source node.
sudo umount /opt/backup
-
Check to ensure that the drive is no longer mounted.
df -h | grep backup
-
-
Detach the drive in vCenter.
Switch back over to vCenter and detach the drive that was unmounted from the file system.
-
Right-click on your source virtual machine and select Edit Settings.
-
Select the value to the right of Total hard disks.
-
Hover over the rightmost side to display an X icon to detach the drive. Click the X icon.
-
Expand the new hard disk to view the various aspects of the drive.
Note:Ensure that the Disk File path and name are saved for later use. Do not select the option to delete the files from data store or else the drive and backup file contents are lost.
Click OK.
-