1. Converting a Host to Red Hat Enterprise Linux with Convert2RHEL
Convert2RHEL enables the conversion of Red Hat Enterprise Linux derivative distributions into a supportable Red Hat Enterprise Linux state while retaining existing applications and configurations.
The conversion process is similar to a minor release upgrade of Red Hat Enterprise Linux in which every RPM package on the system is replaced. Third-party packages and non-Foreman community packages not available in Red Hat Enterprise Linux are not replaced.
You can convert:
-
CentOS 7 to Red Hat Enterprise Linux 7
-
Oracle 7 to Red Hat Enterprise Linux 7
-
CentOS 8 to Red Hat Enterprise Linux 8
-
Oracle 8 to Red Hat Enterprise Linux 8
You cannot convert a version 7 package into Red Hat Enterprise Linux 8, or a version 8 package into Red Hat Enterprise Linux 7.
Convert2RHEL removes unnecessary packages such as logos, or packages known to cause issues during the conversion, and replaces the CentOS-release
or Oracle-release
package with the rhel-release
package.
It subscribes the system to Foreman and replaces all packages signed by CentOS or Oracle.
The amount of time taken to do this can vary depending on how many packages need to be replaced, network speed, storage speed, and similar variables.
Use the global registration template to register and subscribe your system before the conversion. For more information, see Registering a Host to Foreman Using the Global Registration Template in the Managing Hosts guide.
Parts of the process can be achieved using the theforeman.foreman.convert2rhel role assigned to the host or host groups.
The Ansible role prepares data, that is, repositories, certificates, activation keys and host groups required for the host conversion.
The role enables the rhel-7-server-rpms
repository with the 7Server release and x86_64 architecture, as well as rhel-8-for-x86_64-baseos-rpms
and rhel-8-for-x86_64-appstream-rpms
.
Using the Ansible role to automate the Convert2RHEL process generates activation keys.
To convert hosts to Red Hat Enterprise Linux with convert2RHEL, you must complete the following procedures:
-
You must have completed the steps listed in Preparing for a RHEL conversion.
-
If you are providing the organization ID and activation key to register and subscribe your system, you must have created an activation key in Foreman. For more information, see Managing Activation Keys in this guide, and Understanding activation keys in Subscription Manager documentation.
-
Ensure you have a subscription manifest uploaded to your Foreman and that there are sufficient Red Hat Enterprise Linux subscriptions for the conversion.
-
If you are providing the organization ID and activation key to register and subscribe your system, you must have created an activation key in Foreman or Subscription Manager. For more information, see Managing Activation Keys in this guide, and Understanding activation keys in Subscription Manager documentation.
-
Ensure you have a subscription manifest uploaded to your Foreman and that there are sufficient Red Hat Enterprise Linux subscriptions for the conversion.
The manifest provides access to all enabled content for the role to work properly. You can download the manifest and put it in the correct folder. The subscription manifest is retrieved from the specified path on the Ansible target host. Optionally, it can be fetched first from the RHSM portal using the provided login credentials and manifest UUID. It will be uploaded to the specified organization.
-
If you are accessing Red Hat Enterprise Linux packages using Foreman server, you must use the organization ID and activation key to run the
convert2rhel
command.
1.1. Importing the Convert2RHEL Ansible Role and Variables
You must have imported Ansible roles to use. If you have not, the following procedure imports Ansible Roles for you to assign.
-
In the Foreman web UI, navigate to Configure > Roles.
-
If you have not imported Ansible roles, click the Import from button.
-
The Roles page displays the Ansible roles.
-
Check the Select All checkbox.
-
Click Submit to import the roles.
1.2. Assigning the Convert2RHEL Role to Foreman server
Use this procedure to assign the Ansible Role to Foreman server.
-
In the Foreman web UI, navigate to Hosts > All Hosts.
-
Select your Foreman server and click the Edit button.
-
Click the Ansible Roles tab and from the Available Ansible Roles list, search for the
theforeman.foreman.convert2rhel
role. -
Click the
+
icon to add it to the Assigned Ansible Roles for Foreman server. -
Click Submit.
Continue by creating the required variables. For more information, see Creating Variables for the Convert2RHEL Role.
1.3. Creating Variables for the Convert2RHEL Role
Assigning the Ansible role to a host also installs variables. You must create the following additional variables:
Name | Type | Default value and description | Example |
---|---|---|---|
foreman_rhel_wait_for_syncs |
boolean |
false |
false |
foreman_manifest_path |
string |
path to manifest |
/root/manifest_Sat_20220623T124844Z.zip |
foreman_organization |
string |
name of organization |
Default Organization |
foreman_password |
string |
your admin password |
My_Admin_Password |
foreman_server_url |
string |
Foreman server URL |
foreman.example.com |
foreman_username |
string |
admin |
admin |
foreman_validate_certs |
boolean |
Set to |
true |
foreman_content_rhel_enable_rhel7 |
boolean |
Set to |
false |
foreman_content_rhel_enable_rhel8 |
boolean |
Set to |
true |
If you want to use Convert2RHEL on Oracle Linux 7 or 8, create an additional variable depending on the conversion you intend:
OS type | Name | Type | Default value to set |
---|---|---|---|
Oracle Linux 7 |
foreman_convert2rel_enable_oracle7 |
boolean |
true |
Oracle Linux 8 |
foreman_convert2rel_enable_oracle8 |
boolean |
true |
Use the following procedure to create variables.
-
In the Foreman web UI, navigate to Configure > Variables.
-
Click on the New Ansible Variable button.
-
In the Key field of the Create Ansible Variable page, enter the name of the variable.
-
Optional: In the Description field, enter a description of the variable.
-
In the Ansible Role field, set the role the variable is assigned to. In this case, theforeman.foreman.convert2rhel.
-
Optional: Under Default Behavior, select the Override checkbox.
-
Set Parameter type to the value type for validation. For example, a string or boolean variable.
If you want to create data for Oracle 7 you must change the Parameter type for foreman-convert2rhel_enable_oracle7 to boolean, and set the value to
true
.If you want to create data for Oracle 8 you must change the Parameter type for foreman-convert2rhel_enable_oracle8 to boolean, and set the value to
true
. -
Optional: In the Default Value field, enter the default value that you want to use if there is no match for the variable.
-
Optional: Check the Hidden Values checkbox if you do not want to display the Ansible variable in plain text.
-
Optional: Under Prioritize Attribute Order, in the Order window, list the order of the attributes.
-
Optional: Check Merge Overrides if you want to add all further matched parameters after finding the first match. Check Merge Default if you want to also include the default value even if there are more specific values defined. Check Avoid Duplicates if you want to create a list of unique values for the selected variable.
-
Optional: The Specify Matcher field requires an attribute type from the order list.
-
Optional: Use the Add Matcher button to add more matchers.
-
Click Submit.
1.4. Registering Hosts for Conversion
Use this procedure to register CentOS hosts to Foreman.
Activation keys produced by the Ansible role are as follows:
-
convert2rhel_centos7 - used for registering centos7 hosts.
-
convert2rhel_centos8 - used for registering centos8 hosts.
-
convert2rhel_oracle7 - used for registering oracle7 hosts.
-
convert2rhel_oracle8 - used for registering oracle8 hosts.
-
convert2rhel_rhel7 - used for re-registering a host converted to RHEL 7.
-
convert2rhel_rhel8 - used for re-registering a host converted to RHEL 8.
-
In the Foreman web UI, navigate to Hosts > All Hosts and click Register Host.
-
In the Host Group field, select the Host Group you want to use as a template for the conversion. You can also select one of the following predefined Host groups:
-
CentOS7 converting
-
CentOS8 converting
-
Oracle Linux 7 converting
-
Oracle Linux 8 converting
-
The activation keys for these Host groups are automatically applied.
-
Optional, In the Operating System field, select the Operating System you are converting from.
-
Optional: In the Smart Proxy field, select the required Smart Proxy.
-
Optional: Check the Insecure box if the hosts might not trust the Foreman CA.
-
Optional: In the Remote Execution Interface field, if the host has multiple interfaces and remote execution must use a single one, select the appropriate network interface.
-
In the Activation Key(s) field, enter the name of the content activation key.
-
Click Generate Command.
When you run the command on the hosts you want to convert, it is registered in Hosts > All Hosts. If the host subscription status warns of Unknown subscription status, it can be ignored.
1.5. Running the Convert2RHEL Ansible Playbook
Use this procedure to install Convert2RHEL and perform the conversion.
-
In the Foreman web UI, navigate to Hosts > All Hosts and select the target hosts on which you want to execute the remote job. You can use the search field to filter the host list.
-
From the Select Action list, select Schedule Remote Job.
-
On the Job invocation page, define the main job settings:
-
Select the Job category and the Job template to use. Use Convert2RHEL for both.
-
Optional: Select a stored search string in the Bookmark list to specify the target hosts.
-
Optional: Limit the targeted hosts by entering a Search query. The Resolves to line displays the number of hosts affected by your query. Use the refresh button to recalculate the number after changing the query. The preview icon lists the targeted hosts.
-
In the Activation Key field, select the activation key associated with the conversion you are doing. you must choose either
convert2rhel_rhel7
orconvert2rhel_rhel8
. -
Check Restart if you want to restart the machine after the conversion is complete. The remaining settings might not display when you select the Convert2RHEL template.
-
Optional: To configure advanced settings for the job, click Display advanced fields. Some of the advanced settings depend on the job template, the following settings are general:
-
Effective user defines the user for executing the job, by default it is the SSH user.
-
Concurrency level defines the maximum number of jobs executed at once, which can prevent overload of systems' resources in a case of executing the job on a large number of hosts.
-
Timeout to kill defines time interval in seconds after which the job should be killed, if it is not finished already. A task which could not be started during the defined interval, for example, if the previous task took too long to finish, is canceled.
Concurrency level and Timeout to kill settings enable you to tailor job execution to fit your infrastructure hardware and needs.
-
Type of query defines when the search query is evaluated. This helps to keep the query up to date for scheduled tasks.
-
Execution ordering determines the order in which the job is executed on hosts: alphabetical or randomized.
-
-
Optional: From the Type of query field, check Static query or Dynamic query.
-
To run the job immediately, ensure that Schedule is set to Execute now. You can also define a one-time future job, or set up a recurring job. For recurring tasks, you can define start and end dates, number and frequency of runs.
-
Click Submit. This displays the Job Overview page, and when the job completes, also displays the status of the job.
-
Note that:
-
The conversion can take some time.
-
During the conversion, the host reboots.
-
After the reboot, new OS facts are sent to Foreman.
-
When complete, the OS for the host changes to Red Hat Enterprise Linux and the subscription status turns green.
-