We recommend you review the latest Convert2RHEL documentation before proceeding.
NOTE You will need to provide some login credentials so that Convert2RHEL can to pull packages from Red Hat’s CDN service. The supplied ansible playbook will automate the registration providing you’ve got a valid secrets.yaml. A sample secrets.yaml.example has been provided which you’ll need to update with a username and password.
cd ansible
cp secrets.yaml.example secrets.yaml
nano secrets.yaml
# Update the secrets file
cd -
NOTE There have been recent Centos 7.x kernel updates that block the convert2rhel tools if you’re using the Cento 7.9 image recommended in the local VM deployment guide. The following will update to the latest kernel and resolve the issue.
ssh leapp2rhel
# wait for the login to complete
yum check-update ; yum -y upgrade kernel && reboot
NOTE If you’re using the standard Centos 8 Cloud Image from the previous step this will need to be patched to Centos 8.5 before running Convert2RHEL.
As Centos 8 is now EOL you need to update the YUM repostory to point to vault.centos.org in order to update. The setup-convert2rhel.yml step below now includes automation to update the Centos instance to point at the correct repositories and you can skip the manual steps below.
ssh leapp2rhel
# wait for the login to complete
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
dnf -y distrosync
# Confirm we're running version 8.5
cat /etc/centos-release
logout
We’re going to use an ansible playbook from the upstream OS and Application Modernization Group repository to install the core requirements for convert2rhel.
cd ansible
curl -L -O https://github.com/oamg/convert2rhel/raw/main/ansible/setup-convert2rhel.yml
ansible-playbook -i hosts setup-convert2rhel.yml
For the run portion we need to make sure we’ve got a valid Red Hat portal login in our secrets.yaml (see above).
This run can take around 10-15 minutes depending on your connection and VM performance, and once completed the VM will be automatically rebooted.
curl -L -O https://github.com/oamg/convert2rhel/raw/main/ansible/run-convert2rhel.yml
ansible-playbook -i hosts run-convert2rhel.yml --extra-vars "@secrets.yaml"
If you want to monitor conversion progress you can remote into the virtual machine and monitor the convert2rhel logs.
ssh leapp2rhel tail -f /var/log/convert2rhel/convert2rhel.log
This approach is useful in a customer environment if they want to see the console level feedback from the convert2rhel tooling. Whist you can use the Convert to RHEL documentation to perform the setup tasks manually, I recommend you use the setup-convert2rhel.yml step above. You can then SSH in and perform the conversion.
NOTE you will be prompted for your Red Hat support portal username and password.
ssh leap2rhel
convert2rhel
ssh leapp2rhel cat /etc/os-release
This should produce output similar to the following for a Centos 7 to Red Hat Enterprise Linux migration
NAME="Red Hat Enterprise Linux Server" VERSION="7.9 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.9" PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.9 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
And the following for a Centos 8 to Red Hat Enterprise Linux migration
NAME="Red Hat Enterprise Linux" VERSION="8.5 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.5" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.5 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos" HOME_URL="https://www.redhat.com/" DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.5 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.5"