Bookmark this page

Perform a Conversion to RHEL by using Red Hat Satellite

Objectives

  • Use Red Hat Satellite to convert a server from CentOS Linux to RHEL.

Converting Hosts with Red Hat Satellite

If your organization uses Red Hat Satellite, then you can use it to convert multiple hosts to Red Hat Enterprise Linux at the same time.

The basic procedure is as follows:

  • On Red Hat Satellite, you use an Ansible Role to help prepare Satellite Server to run conversions to RHEL.

  • You register the non-RHEL hosts that you plan to convert to your Red Hat Satellite Server, and prepare them for automated remote execution and conversion.

  • On your Satellite Server, you run automation to perform pre-conversion analysis and the actual conversion on each host.

  • You validate the systems that were converted by Satellite in the same way that you validate systems that are converted from the command line.

Preparing Satellite to Run a Conversion

This section assumes that Red Hat Satellite 6.14 is already installed and operating correctly. For more information about Red Hat Satellite, refer to https://learn.spidernet.pl/satellite.

Confirm that the Subscription Manifest Contains Entitlements

You must have a Red Hat Satellite subscription manifest with sufficient Red Hat Enterprise Linux entitlements allocated for all the conversions that you intend to perform. Confirm that you have installed the subscription manifest on your Satellite Server.

In the Satellite Server web UI, select ContentSubscriptions to view the total number of appropriate entitlements and how many are already in use. You can click View Subscription Usage on that page to visit the Red Hat Hybrid Cloud Console (https://console.redhat.com), where you can update your subscription manifest to add subscriptions.

Note

Enabling Simple Content Access for your organization can make subscription management simpler by removing the need to attach subscriptions at a per-system level. This configuration can help the conversion process to go more smoothly.

Enable the RHEL Repositories

Confirm that you have enabled the Satellite repositories for the version of Red Hat Enterprise Linux to which you plan to convert the hosts.

The hosts that you plan to convert require access to the Convert2RHEL software repository and the repositories for the correct version of Red Hat Enterprise Linux. For example, if you are converting CentOS Linux 7 to RHEL 7, then the hosts require access to the RHEL 7 software repositories.

Make sure that the required repositories are enabled. In the web UI of your Satellite Server, navigate to ContentRed Hat Repositories. For conversions to Red Hat Enterprise Linux 7 for x86_64, you must have at least the Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server (rhel-7-server-rpms) repository enabled. If this repository is not enabled, then find it in the Available Repositories pane, click the repository name, and then click the plus symbol (+) to enable it. You might also choose to enable the Optional, Extras, or Supplementary repositories for RHEL 7.

Important

If you are converting to Red Hat Enterprise Linux 8 for x86_64 directly from a distribution such as CentOS Linux 8, then enable the BaseOS (rhel-8-for-x86_64-baseos-rpms) and AppStream (rhel-8-for-x86_64-appstream-rpms) repositories.

Import the Ansible Role

The next step is to import an Ansible Role into Satellite Server. You run this Ansible Role on your Satellite Server to help configure your Satellite Server to perform RHEL conversions.

In the Satellite Server web UI, go to ConfigureAnsibleRoles. Click Import from your-satellite-name .

Use the less than (<) and greater than (>) buttons at the lower right of the Changed Ansible roles page until you find the redhat.satellite.convert2rhel role in the list. Select its checkbox, and then click Submit.

If this operation succeeds, then you return to the ConfigureAnsibleRoles page and the redhat.satellite.convert2rhel role is on the list of available roles.

Configure the Ansible Role

For the Ansible Role to function correctly, you must set some Ansible variables that configure the redhat.satellite.convert2rhel role.

Navigate to ConfigureAnsibleRoles. In the table of roles, locate the row for the redhat.satellite.convert2rhel role. On that row, in the Variables column, click the link that displays the number of variables for that role. That link opens a page that lists all the variables that are used by that role.

You must set the following Ansible variables for the role. Some variables are preconfigured by the role and can be edited in the Satellite web UI. Most of the variables are not automatically created or configured, so you must create them by clicking New Ansible Variable, and then configure them in the web UI.

If you must create the variable, then enter the following parameters on the Create Ansible Variable page:

  • Key is the name of the variable.

  • Ansible Role is redhat.satellite.convert2rhel.

  • Override must be selected.

  • Parameter Type is the type of the variable, for example string or boolean.

  • Default Value is the variable's default value. Set the appropriate value for the variable, based on the following discussion of the Ansible Role variables that you must set.

To convert a CentOS Linux system to RHEL, you must set the following Ansible variables for the redhat.satellite.convert2rhel role.

satellite_server_url

String. The URL of your Satellite Server, such as https://satellite.example.com.

satellite_username

String. The username of a Satellite account that can make administrative changes to Satellite.

satellite_password

String. The password for the username in the satellite_username variable.

satellite_organization

String. The name of your Satellite organization.

satellite_validate_certs

Boolean. Set to true to validate TLS certificates, or false to not validate.

satellite_convert2rhel_manage_subscription

Boolean. Set to false if your Satellite Server has a valid manifest.

satellite_content_rhel_enable_rhel7

Boolean. Set to true if you intend to convert directly to RHEL 7, or false otherwise.

satellite_content_rhel_enable_rhel8

Boolean. Set to true if you intend to convert directly to RHEL 8, or false otherwise.

Note

If you are converting Oracle Linux systems, then other variables might be needed. Refer to the Converting a Host to Red Hat Enterprise Linux section of the Managing Hosts guide for details.

Run the Ansible Role on Satellite Server

To configure your Satellite Server to perform conversions to RHEL, you must run the redhat.satellite.convert2rhel Ansible Role.

Navigate to HostsAll Hosts. From the list of hosts, click the hostname of your Satellite Server.

Click the Ansible tab. If no roles are assigned to your Satellite Server, then click Assign roles directly to this host; otherwise, click Edit Ansible roles.

In the Edit Ansible Roles interface, make sure that the redhat.satellite.convert2rhel role is listed under Host assigned Ansible roles. Click Confirm. That role is now assigned to your Satellite Server.

Return to HostsAll Hosts. Make sure that only your Satellite Server is selected, and no other hosts. Run the role on your Satellite Server by clicking Select Action, and then selecting Run all Ansible roles.

If the Ansible Role succeeds, then you can continue to the next step. If the Ansible Role fails, then click the name of your Satellite Server at the end of the job page and review the output to determine what went wrong.

Synchronize Software Repositories

Make certain that the software repositories that are configured on your Satellite Server are up to date.

In the Satellite Server web UI, navigate to ContentProducts. For RHEL 7, make sure that the Red Hat Enterprise Linux Server product has been synchronized. If this product has not been synchronized, then click its name. On the Repositories page for that product, select the checkboxes for all the repositories and click Sync Now to ensure that the latest packages are available.

You should also confirm that the Convert2RHEL7 product has been synchronized in the same way.

Important

If you are converting to RHEL 8 for x86_64 directly from a distribution such as CentOS Linux 8, then the names of the products are Red Hat Enterprise Linux for x86_64 and Convert2RHEL8.

Configure and Publish Content Views for Conversion

The next step is to add the repositories in those products to a content view that Convert2RHEL uses for the conversion.

In the web UI for your Satellite Server, navigate to ContentContent Views. If you are converting to RHEL 7 for x86_64, then the Ansible Role that you ran on your Satellite Server should have created a content view named convert2rhel_centos7. Select that content view by clicking its name.

On the convert2rhel_centos7 page, select the Repositories tab. On the Type list, select All repositories, and on the Status list, select All.

Select the checkboxes for the Convert2RHEL7 main repository, the Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server repository, and any other repositories for RHEL 7 that you want to have available during the conversion process. Click Add repositories.

Then, publish the changed content view by clicking Publish new version. In the Publish pane displayed by Satellite Server, select Promote, assign the content view to a lifecycle environment (select Library if you have no others), and click Next. Review the details on the next page, and then click Finish. Wait for the content view to be published.

Configure Activation Keys for Conversion

When you perform a pre-conversion analysis or an actual conversion of your hosts with Red Hat Satellite, you use an activation key to grant your hosts access to the content view.

In the Red Hat Satellite web UI, navigate to ContentActivation Keys. If you are converting to RHEL 7, then the Ansible Role created an activation key that is named convert2rhel_centos7. The content view assigned to the activation key is probably set to Default Organization View when you first visit the page. You must select the content view that you want to use for the conversion.

Click the name of the activation key (convert2rhel_centos7) and on the next page, find the Activation Key Content heading. Under that heading, set Environment to the name of the lifecycle environment to which you assigned the content view that you want to use (Library in this example). For Content View, select the convert2rhel_centos7 content view. Click Save to save your changes.

Note

For CentOS Linux 7 conversions, the Ansible Role sets up two activation keys, convert2rhel_centos7 and convert2rhel_rhel7. The distinction between them does not seem to be clearly documented, but you could choose to use one for pre-conversion analysis and the second for conversion or post-conversion activation.

For CentOS Linux 8 conversions, the convert2rhel_centos8 and convert2rhel_rhel8 activation keys are available.

Preparing Hosts for Conversion

To prepare the hosts for conversion to RHEL by using Satellite, you must complete the following tasks:

  • Back up your hosts and verify that they can be restored if necessary.

  • Review the known issues and limitations that are documented in the Known Issues and Limitations section of the Converting from an RPM-based Linux Distribution to RHEL guide.

  • Ensure that the standard kernel is the currently running kernel on those hosts. (On CentOS Linux, ensure that you are not running the real-time kernel. On Oracle Linux, ensure that you are running the Red Hat Compatible Kernel (RHCK).)

  • Remove any CentOS Stream packages from your hosts. (CentOS Stream conversion to RHEL is not currently supported.)

Configure Hosts to Allow Remote Execution by Satellite

On each host to be converted to RHEL by Satellite, you must enable remote execution by the Satellite Server that will perform the conversion.

If you can log in to the root account on a host, then you can enable remote execution manually from Satellite Server by running the following command as the root user on Satellite Server:

ssh-copy-id -i ~foreman-proxy/.ssh/id_foreman_proxy.pub root@host

Alternatively, if the curl command is installed on each host, then you can download and install the key by running the following commands as the root user account on each host.

  1. If the /root/.ssh directory does not exist, then create it:

    [root@host ~]# mkdir /root/.ssh
  2. Run the following command so that Satellite Server can authenticate to the root user account on the host:

    [root@host ~]# curl -k https://satellite:9090/ssh/pubkey \
    >> ~/.ssh/authorized_keys
  3. Set the correct permissions for the ~/.ssh directory:

    [root@host ~]# chmod 700 ~/.ssh
  4. Set the correct permissions for the authorized_keys file:

    [root@host ~]# chmod 600 ~/.ssh/authorized_keys

Register Hosts to Red Hat Satellite

The next step is to make sure that the non-RHEL hosts that you plan to convert to RHEL are registered with your Red Hat Satellite Server. If the curl command is installed on your non-RHEL hosts, then you can generate a curl command on Satellite to run on your hosts to register them.

  1. On your Satellite Server, navigate to HostsRegister Host.

  2. On the General tab, configure the following settings:

    • The Organization and Location should be set to the values that you want for the host that is being converted.

    • Set Host Group to CentOS 7 converting if you are converting from CentOS Linux 7.

    • Set Activation Keys to convert2rhel_centos7 if you are converting to RHEL 7.

    • Select Insecure if your host has not been configured with the TLS CA certificate that signed the Satellite Server's TLS certificate.

  3. On the Advanced tab, set the Lifecycle Environment to the lifecycle environment that you want your host to use after conversion.

  4. Click Generate.

Copy the command that displays below the Generate button. By default, this command is valid for four hours.

Run that command as the root user on each host that you want to register with Satellite. After the command completes, in the web UI on your Satellite Server, go to HostsAll Hosts and confirm that the host you just registered appears in the list of hosts.

Run Pre-conversion Analysis of the Hosts

Navigate to HostsAll Hosts in the web UI of your Satellite Server, and select the checkbox for each host on which you want to perform a pre-conversion analysis. Then, click the Select Action button at the upper right of the UI, and select Schedule Remote Job.

On the first Run job page, set Job category to Convert 2 RHEL, and set Job template to Convert to RHEL analyze. Click Skip to review.

On the review page, confirm that all the hosts that you plan to analyze are listed, that Job template is set to Convert to RHEL analyze, that Schedule type is set to Immediate execution, and that Type of query is set to Static query. If everything looks correct, then click Submit.

Satellite Server starts the convert2rhel analyze job on the hosts that you selected. Wait until the job has succeeded or failed on all hosts. At the end of the job page is a list of all the hosts that are being analyzed and their current status.

Click the hostname of a host to review the pre-conversion analysis report for that host. Correct any errors that you find and repeat the preceding steps until the pre-conversion analysis report is successful.

Converting the Hosts to Red Hat Enterprise Linux

Converting your hosts with Satellite is similar to running the pre-conversion analysis.

Navigate to HostsAll Hosts in the web UI of your Satellite Server again. Select the checkbox for each host that passed its pre-conversion analysis that you want to convert. Then click Select Action at the upper right of the UI and select Schedule Remote Job again.

On the first Run job page, set Job Category to Convert 2 RHEL, but this time, set Job template to Convert to RHEL, and then click Next.

On the Target jobs and inputs page, set Activation key to convert2rhel_rhel7 if you are converting to RHEL 7, and set Restart to yes. Click Skip to review.

Review the parameters on the Review details page. Make sure that the Job template is set to Convert to RHEL, that the Target hosts lists only the hosts that you want to convert, that Schedule type is set to Immediate execution, and that Type of query is set to Static query. After confirming that all settings are correct, click Submit.

Warning

After you click Submit, the conversion process starts for all target hosts. Changes made after this point in the conversion process might be difficult or impossible to undo. Be certain that you are ready to perform the conversion before clicking Submit.

On the job page, wait until the job has succeeded or failed on all hosts. At the end of the job page is a list of all the hosts that are being converted and their current status.

After the job completes, inspect the results for each host and validate that the conversions succeeded. Validating the conversions and addressing post-conversion issues are covered in a separate section of this course.

You can assign the converted hosts to a different host group and manage these hosts like other RHEL systems in Red Hat Satellite.

References

For more information about the conversion process, refer to the Converting a Host to Red Hat Enterprise Linux chapter in the Managing Hosts guide for Red Hat Satellite 6.14 at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_hosts/index#converting-a-host-to-rhel_managing-hosts

For more information about registering hosts in Red Hat Satellite, refer to the Registering Hosts by Using Global Registration section in the Managing Hosts guide for Red Hat Satellite 6.14 at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_hosts/index#Registering_Hosts_by_Using_Global_Registration_managing-hosts

Revision: rh174-7.9-0acf85c