Migrated the OS from RHEL7 to RHEL8 without creating new servers
Introduction
Exploring the challenge of upgrading servers from RHEL7 to RHEL 8 while avoiding
the need for a fresh installation, we delve into the intricacies and solutions for customers seeking seamless transitions.
Solution
We have installed the LEAPP utility servers and migrated the OS from RHEL7 to RHEL8 with
the help of LEAPP
Steps followed are mentioned below
STEP 1:
To upgrade from RHEL 7 to 8, first, it is necessary to upgrade the instance to the latest minor release of RHEL 7. This can be done using the following commands :
sudo su yum update-y reboot
After rebooting the instance, make sure that the upgrade has worked and the instance has booted with the latest RHEL 7 kernel available :
STEP 2:
Since we are upgrading using RHUI on a public cloud, we need to enable the required RHUI repositories and install the required RHUI packages to ensure our system is ready for upgrade. In order to perform further steps, a utility called “leapp” must be installed.
Leapp is a CLI tool that helps users with the installation process and makes the in-place upgrade easier. Hence, to install it, first enable the necessary RHUI repositories and then install the package. Both these tasks can be done using the following command:
yum install-y leapp leapp-rhui-aws leapp-repository leapp-repository-deps lvm2-python-boom--enablerepo=*
STEP 3:
For a successful in-place upgrade from Red Hat Enterprise Linux 7 to Red Hat Enterprise Linux 8, the Leapp utility requires data attached to this article to be placed in the /etc/leapp/files/ directory on the target system.
The data files include RPM package changes (pes-events.json), RPM repository mapping
(repomap.csv), and information about removed or unsupported kernel drivers
(unsupported_driver_names.json, unsupported_pci_ids.json). You can download the file
leapp-data17.tar.gz from the link below and move it to your RHEL 7 instance.
https://access.redhat.com/articles/3664871
I have also attached it to this KUMO. Please check the attachment. After copying the archive, run the following command to extract it and copy the contents to- “/etc/leapp/files” directory :
tar-xzf leapp-data17.tar.gz-C /etc/leapp/files && rm-rf leapp-data17.tar.gz
STEP 4:
After copying these files, check if pam is using “pam_pkcs11.so” because during the in-place
upgrade, the deprecated pam_krb5 or pam_pkcs11 pluggable authentication modules (PAM) are removed. To work around this problem, reconfigure your RHEL 7 system so you do not use pam_krb5 or pam_pkcs11 before upgrading. To do this, edit the files below :
vi /etc/pam.d/smartcard-auth-ac "pam_pkcs11.so"). vi /etc/ssh/sshd_config
(In this file, comment on all the entries which contain
(In this file uncomment permit root login option).
STEP 5:
Perform the pre-upgrade phase by running the command :
leapp preupgrade–no-rhsm
STEP 6:
After the command returns successfully, perform the actual upgrade using Leapp :
leapp upgrade–no-rhsm
STEP 7:
Then reboot the EC2 instance :
Reboot
It might take a couple of minutes to boot it for the first time. After rebooting, check if the instance is booted with a newer kernel or newer release. Please also check the status of the instance screenshot from the EC2 dashboard.
cat /etc/redhat-release Red Hat Enterprise Linux release 8.4 (Ootpa) uname-r 4.18.0-305.el8.x86_64