Convert2RHEL is a script that makes it easier to switch to Red Hat Enterprise Linux (RHEL). Conceptually, it's simple. The script replaces non-RHEL packages from CentOS Linux or Oracle Linux (and soon Rocky Linux and Alma Linux) with signed RHEL packages. At the time of this writing, the supported conversions are:
- CentOS Linux 7.9 to RHEL 7.9
- CentOS Stream 8 to RHEL 8
- Rocky 8 to RHEL 8
Red Hat’s Convert2RHEL utility enables a guided and supported conversion in 3 basic steps:
- Configures access to authentic RHEL content in your instance.
- Performs various safety checks and reviews informational and remediation guidance on how to proceed.
- Performs the conversion by replacing every operating system package with its RHEL equivalent. There is no application or data to migrate. Rocky Linux and CentOS Linux components are simply replaced by the equivalent RHEL components. This is somewhat equivalent to a minor release update, in which most or all packages are updated, and it takes the same amount of time.
This article explains how the Convert2RHEL tool simplifies two common paths for converting CentOS Linux instances running on a public cloud to a fully supported RHEL, including:
- Convert a CentOS Linux instance in-place to RHEL with Pay As You Go (PAYG) using the Bring Your Own Subscription (BYOS) model.
- Convert a CentOS Linux instance in-place to RHEL using the BYOS model.
What is a supported conversion?
When a conversion is supported, it means that the tooling is not expected to produce an error, and that Red Hat is able to provide technical support to subscription owners during the conversion process.
Red Hat recently announced an extension to RHEL 7.9 ELS. This means that if you're a CentOS Linux 7 user, you have plenty of time to get to a new release once you've converted your system to RHEL.
What is an unsupported conversion?
Convert2RHEL can replace packages on RHEL versions that are not on the list of supported options. If you choose to convert from an unsupported version, Red Hat does NOT provide support for the conversion itself, but does support the resulting RHEL installation (assuming the conversion works). Not all supported RHEL versions are targets for conversion, but you can convert up to a major release (like 8 or 9), and then follow the standard upgrade path to the latest supported minor release.
Convert2RHEL in GCP - Pay As You Go (PAYG)
Because of the way Convert2RHEL works, you can attempt to convert a virtual machine (VM) from CentOS Linux to RHEL in pretty much any location. GCP utilizes custom integrations (as do most cloud providers) with the cloud to allow for a seamless, fully managed VM environment. These integrations usually require some customization to fully convert the VM. GCP uses a Red Hat Update Infrastructure (RHUI) client to provide PAYG capabilities.
An important set of rules apply to every RHEL subscription in the cloud:
- The customer must sign Red Hat’s terms and conditions.
- The customer cannot enable access to Red Hat content before agreeing to terms and conditions.
- The provider is responsible to bill the customer from the moment access to the bits is enabled.
- The provider is responsible for requirements around dissemination of the bits.
To convert a RHEL instance with Red Hat Update Infrastructure (RHUI), first download the script that applies to your instance:
GCP CentOS Linux 7.9
sudo bash <(curl -s \
https://raw.githubusercontent.com/MCurtisRedhat/CloudCent2RHEL/main/CentOS7toRhel7.sh)
To perform a manual conversion, you must create a global variable to prevent Convert2RHEL from looking for packages (because you will add them manually later) as superuser.
Make sure that your kernel is up to date (this is important as convert2rhel will not check your kernel version:
sudo yum install kernel-3.10.0-1160.102.1.el7 -y
Download the GPG key and repository:
/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repo
curl -o ./gce-google-rhui-client-el7-x86_64-stable.rpm https://packages.cloud.google.com/yum/repos/gce-google-rhui-client-el7-x86_64-stable/Packages/819edaaa38ddbbb792684fa53b6dbbdff8a9ba22aa8e4aca96441df1130f7fb1-google-rhui-client-rhel7-8.0-1.noarch.rpm
Update the system:
yum -y update
Install the Convert2RHEL package:
yum -y install convert2rhel
Update your kernel, and then reboot:
yum install kernel-3.10.0-1160.102.1.el7 -y
Install some supporting files:
yum install -y dhclient dhcp-common dhcp-libs gettext gettext-libs mokutil shim-x64
This configures access to a repository, so it might cause yum
to become unusable until after a reboot:
yum install gce-google-rhui-client-el7-x86_64-stable.rpm
Edit the repository to reflect the location of the files correctly:
sed -i 's/$releasever/7Server/g' /etc/yum.repos.d/rh-cloud.repo
Reboot to ensure that your package manager is functional:
reboot
After the reboot, install supporting packages and then run convert2rhel.
Assume superuser roles with SU and create global variables that will prevent convert2rhel from checking for kernel version and outdated packages (GCP uses specific booting mechanisms that conflict with convert2rhel expectations, additionally we will manually remove the kernel checking
sudo su
export CONVERT2RHEL_OUTDATED_PACKAGE_CHECK_SKIP=1
export CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK=1
sed -i 's/raise _AnalyzeExit()/#raise _AnalyzeExit()/g'/usr/lib/python2.7/site-packages/convert2rhel/main.py
Now run convert2RHEL:
convert2rhel --debug --enablerepo rhui-rhel-7-server-rhui-rpms --no-rhsm -y
sudo restart
GCP CentOS Linux 8 Stream:
sudo bash <(curl \
-s \ https://raw.githubusercontent.com/MCurtisRedhat/CloudCent2RHEL/main/CentOS2RHEL8.sh)
To perform a manual conversion, first download the repository verification keys and configuration files:
sudo curl -o \
/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
sudo curl --create-dirs -o \
/etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
sudo curl -o \
/etc/yum.repos.d/convert2rhel.repo \
https://ftp.redhat.com/redhat/convert2rhel/8/convert2rhel.repo
sudo curl -o ./google-rhui-client-rhel8-4.0-1.noarch.rpm \
https://packages.cloud.google.com/yum/repos/gce-google-rhui-client-el8-x86_64-stable/Packages/c1afb73c8c5443c696cff1711ebc7427cdaa009df58cb87df418cc5bb1f690e5-google-rhui-client-rhel8-4.0-1.noarch.rpm
Update your system.
sudo yum update
Install the Convert2RHEL package:
sudo yum install convert2rhel
Install some needed support services:
sudo yum install iptables iptables-ebtables iptables-libs krb5-libs \
libnghttp2 python2 python2-libs python2-pip python2-pip-wheel \
python2-setuptools python2-setuptools-wheel python36 qemu-guest-agent \
bash bind-export-libs ca-certificates device-mapper device-mapper-libs \
dmidecode gnupg2 gnupg2-smime gnutls grub2-common grub2-efi-x64 grub2-tools \
grub2-tools-efi grub2-tools-extra grub2-tools-minimal gzip iproute krb5-libs \
libcap libgcrypt libksba libnghttp2 libsemanage libssh libssh-config libtasn1 \
libxml2 nspr openssl openssl-libs pcre2 shim-x64 sqlite-libs vim-common \
vim-enhanced vim-filesystem vim-minimal xz xz-libs
Now update and reboot:
sudo yum install kernel-core-4.18.0-540.el8
You may see an alert that there is nothing to update. In this case , the "kernel update" is really just to synchronize some systems files with your boot configuration.
sudo reboot
Upon reboot, download GCP RHUI clients. Once you install this, your yum
updates will fail until the update is complete, but that's expected. Install the repository for GCP RHUI:
sudo yum install google-rhui-client-rhel8-4.0-1.noarch.rpm
Make some changes to config files to help Convert2RHEL understand the system it's running on:
$ sudo sed -i 's/$releasever/8/g' /etc/yum.repos.d/rh-cloud.repo
$ sudo sed -i 's/8/8.6/g' /etc/system-release
Run convert2rhel
:
sudo convert2rhel --enablerepo rhui-rhel-8-for-x86_64-appstream-rhui-rpms \
--enablerepo rhui-rhel-8-for-x86_64-baseos-rhui-rpms --no-rhsm
GCP Rocky 8
sudo bash <(curl -s \
raw.githubusercontent.com/MCurtisRedhat/CloudCent2RHEL/main/Rocky82RHEL8.sh
After performing these steps and verifying that you have a successful conversion, you must update the license.
Update the license
Currently, there is no automated method to update the license. On a non-GCP console, you must:
- Install the GCP Gcloud CLI
- Install Gcloud components beta
- Initialize the GCP project containing your VM
- Turn down the VM with the command
gcloud compute instances stop <VM_Name>
Enter this in the CLI:
For CentOS Linux 8:
gcloud beta compute disks update <your vm bootdisk name> \
--update-user-licenses=https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-server
For CentOS Linux 7:
gcloud beta compute disks update <your vm bootdisk name> \
--update-user-licenses=https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server
- Start the server with the command:
gcloud compute instances start <VM_Name>
Convert2RHEL in GCP - Bring Your Own Subscription (BYOS)
The first thing to consider is how you intend to pay for your RHEL subscription. You have a few different options.
The first option is an annual subscription for RHEL, which you obtain directly from Red Hat or a reseller.
If you have RHEL subscriptions
First, log in to the Red Hat Hybrid Cloud Console and view your subscriptions.
For the best experience, ensure that Simple Content Access (SCA) is enabled. Otherwise, you must manually specify which subscription to use when you register the instance you wish to convert.
Assuming you're using SCA, navigate to All Apps & Services > Remote Host Configuration > Activation Keys. This allows you to create a named Activation Key, such as my_conversions
, which you provide to the Convert2RHEL utility later. If you choose not to use SCA and activation keys, then you must follow the instructions for registering with the subscription manager tool using a username and password, and then attach a specific subscription. SCA with an activation key is easier, and it's the recommended method.
Start the conversion
Use the Organization ID (found on the Activation Keys page) and the activation key you created in the previous step to enable the Convert2RHEL utility so you can register the system and perform the conversion.
- Red Hat strongly recommends creating backups of your volume in the event of unexpected problems. Within GCP, you can do this by taking a snapshot of the associated Elastic BlockStorage (EBS) volume.
- Review the documentation for Converting from an RPM-based Linux distribution to RHEL so you understand the support matrix, preparations, and other important details.
- Log in to your instance using SSH or the Alicloud terminal to access a shell prompt. You must have permissions to use the sudo command or to become the root super user.
Update to the latest supported version of your existing OS, and install errata updates. Reboot the instance to ensure that the latest updates and kernel are applied.
sudo yum -y update
Copy the certificates to validate that the content is signed by Red Hat.
$ sudo curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release \
https://www.redhat.com/security/data/fd431d51.txt
$sudo curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem \
https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
For CentOS Linux 7
$ sudo curl -o /etc/yum.repos.d/convert2rhel.repo \
https://ftp.redhat.com/redhat/convert2rhel/7/convert2rhel.repo
For CentOS Linux 8
$ sudo curl -o /etc/yum.repos.d/convert2rhel.repo \
https://ftp.redhat.com/redhat/convert2rhel/8/convert2rhel.repo
$ sudo yum -y install convert2rhel
Create a configuration file containing the activation key and save the file in the
.ini
file format. This is the recommended method for activation keys and passwords, to ensure that sensitive information is not leaked. Delete the file when the process is complete. Place this text in the/etc/convert2rhel.ini
file:[subscription_manager]
activation_key = <activation_key>
Run
convert2rhel
:$ sudo convert2rhel --org <Organization_ID> --config-file <config_file_name>
After conversion, it is recommended to register with the Red Hat Insights client to enable additional management capabilities at the Red Hat Hybrid Cloud Console.
$ sudo insights-client --register
- After following the remaining guidance in the documentation, the system is ready to be restarted as a 100% authentic RHEL system. If you registered with Red Hat Insights, then you now see your system in the Inventory.
Cloud-Based Auto-Registration
The other option is to use PAYG. By enabling Auto-Registration, Simple Content Access (SCA), and Subscription Watch, you enable fleet-level registration for Red Hat workloads running in selected public cloud environments. This allows you to auto-connect and gain full access to Red Hat content, analytics, and tools to manage your fleet across multiple hybrid cloud environments. In 3 steps:
- Follow the simple instructions to configure the mapping of Sources between your Red Hat and Cloud Partner accounts in Cloud Based Auto-Registration.
- Enable Subscription Watch (optional but recommended).
- Follow the same instructions defined in the BYOS section above to convert in-place to RHEL.
Try it yourself
Whether you use BYOS or PAYG to pay for Red Hat subscriptions, you have the best and most comprehensive experience possible with Red Hat's support.
For a demonstration of how the Convert2RHEL tool makes this an easy process, try our self-paced labs tutorial to become familiar with the process.
About the author
In the cloud business for 15+ years, Linux Nerd, GCP Nerd
More like this
Browse by channel
Automation
The latest on IT automation for tech, teams, and environments
Artificial intelligence
Updates on the platforms that free customers to run AI workloads anywhere
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
The latest on how we reduce risks across environments and technologies
Edge computing
Updates on the platforms that simplify operations at the edge
Infrastructure
The latest on the world’s leading enterprise Linux platform
Applications
Inside our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Customer support
- Developer resources
- Find a partner
- Red Hat Ecosystem Catalog
- Red Hat value calculator
- Documentation
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit