Use Red Hat Satellite to convert a server from CentOS Linux 7 to RHEL 7.
Outcomes
Use Red Hat Satellite to convert a CentOS Linux server to Red Hat Enterprise Linux.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start convert-satellite
Instructions
On the Satellite Server console, configure the Ansible Role to convert the serverb machine to RHEL 7.
On the workstation machine, open a web browser and navigate to https://satellite.lab.example.com.
The browser displays a certificate warning because Satellite Server uses a self-signed certificate. Click , and then click . Click to accept the self-signed certificate.
Log in as the admin user with redhat as the password.
In the menu that displays in the header of the Satellite web UI, the organization is set to Default Organization and the location is set to Default Location.
Set the organization context by defining a sample organization.
Click the drop-down list and select Operations.
Click the drop-down list and select Any Location.
Select → → from the main menu, and then click .
Search for the redhat.satellite.convert2rhel role and select it.
Click .
Select → → from the main menu, and then click .
Use the following parameters to create variables for the redhat.satellite.convert2rhel role.
Use the variable name as , the variable type as , and the variable value as .
For all variables, select redhat.satellite.convert2rhel as the and select the checkbox.
Click after you finish entering the information of a variable to create it.
Repeat the process to create each variable in the table.
| Variable Name | Variable Type | Variable Value |
|---|---|---|
satellite_server_url
| string |
https://satellite.lab.example.com
|
satellite_username
| string |
admin
|
satellite_password
| string |
redhat
|
satellite_organization
| string |
Operations
|
satellite_content_rhel_wait_for_syncs
| boolean |
true
|
satellite_validate_certs
| boolean |
false
|
satellite_content_rhel_enable_rhel7
| boolean |
true
|
satellite_content_rhel_enable_rhel8
| boolean |
false
|
On the → → page, search for the satellite_convert2rhel_manage_subscription variable and click it.
Select the checkbox and set the field to .
Click .
The Red Hat Satellite Server in the lab environment (satellite.lab.example.com) is already configured with activation keys, content views, and synchronized channels for Convert2RHEL to use.
Therefore, for this exercise, you omit the following steps, which have already been completed for you:
Running the redhat.satellite.convert2rhel role on Satellite Server
Synchronizing the RHEL software repositories
Creating and publishing the content views that are used for the conversion
Creating the activation keys that are used for the conversion
In the next step, you confirm that the content views and activation keys have already been created and that they are properly configured.
Verify the Satellite Server configuration to convert the serverb machine to RHEL 7.
Select → → from the main menu, and then click .
On the tab, verify that the following repositories display the Added status:
CentOS-7-os
CentOS-updates
convert2rhel-for-rhel-7-rpms
Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Select → → from the main menu, and then click .
On the tab, select the checkbox for each of the following repositories:
CentOS-7-os
CentOS-updates
convert2rhel-for-rhel-7-rpms
Click and select Override to Enabled.
Register the serverb system to the Operations organization by using the convert2rhel activation key.
Log in to the serverb machine as the student user.
Switch to the root user.
Use student as the password.
[student@workstation ~]$ssh serverbstudent@serverb's password:student[student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Install the katello-ca-consumer-latest package from Satellite Server (satellite.lab.example.com).
[root@serverb ~]#yum localinstall \http://satellite.lab.example.com/pub/katello-ca-consumer-latest.noarch.rpm...output omitted... Is this ok [y/d/N]:y...output omitted... Is this ok [y/N]:y...output omitted... Complete!
Register the serverb host to Satellite Server by using the convert2rhel activation key.
[root@serverb ~]#subscription-manager register \--activationkey convert2rhel \--org OperationsThe system has been registered with ID: 4beee245-ed55-4562-b15b-d9b88230099c The registered system name is: serverb
Configure the serverb host to allow remote execution by Satellite Server.
Copy the Foreman SSH keys from the satellite machine to the serverb machine.
From the workstation machine, open a second terminal tab and log in to the satellite machine as the student user.
Switch to the root user.
Use student as the password.
[student@workstation ~]$ssh satellite[student@satellite ~]$sudo -i[sudo] password for student:student[root@satellite ~]#
Copy the Satellite Server's Foreman SSH public key to the serverb host.
Use redhat as the password.
[root@satellite ~]#ssh-copy-id -i \~foreman-proxy/.ssh/id_rsa_foreman_proxy.pub \root@serverb.lab.example.com...output omitted... Are you sure you want to continue connecting (yes/no)?yes...output omitted... root@serverb.lab.example.com's password:redhatNumber of key(s) added: 1 ...output omitted...
Use the foreman-proxy private key to confirm that Satellite Server can run remote commands as the root user on the serverb machine.
If the public key was successfully copied, then you can access the root user account on the serverb machine without a password.
You might be prompted to confirm that you want to continue connecting to the remote host.
If so, in this lab environment, you can enter yes.
If you are prompted for a password, then diagnose and fix the issue.
[root@satellite ~]#ssh -i ~foreman-proxy/.ssh/id_rsa_foreman_proxy root@serverb...output omitted... Are you sure you want to continue connecting (yes/no/[fingerprint])?yes...output omitted... [root@serverb ~]#
Prepare the serverb host for conversion to RHEL 7.
In the interest of time, this activity omits performing the usual pre-conversion analysis.
Instead, ensure that the serverb machine is fully updated with the latest version of CentOS Linux 7 software packages, and then continue with the conversion process.
Imagine that you have already completed the pre-conversion analysis, and the only reported issue is to update the CentOS packages.
Exit the open sessions on the second terminal tab and close it.
[root@serverb ~]#exitlogout [root@satellite ~]#exitlogout [student@satellite ~]$exitlogout
On the first terminal tab, review the operating system version of the serverb host.
[root@serverb ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)Update the serverb machine's packages.
[root@serverb ~]#yum update...output omitted... Is this ok [y/d/N]:y...output omitted... Complete!
Reboot the serverb machine.
Wait a minute for the machine to reboot.
[root@serverb ~]# reboot
Connection to serverb closed by remote host.
Connection to serverb closed.
[student@workstation ~]$Use Satellite Server to convert the serverb machine to RHEL 7.
On the web UI, verify that the serverb host is registered with the Operations organization and schedule the conversion to RHEL 7.
Click → , and confirm that the serverb.lab.example.com host is listed as a CentOS 7 system.
Select the checkbox for the serverb.lab.example.com host.
Click and select Schedule Remote Job.
Selecting this action starts a sequence of five pages to configure the remote job that converts the system to RHEL.
On the page, set to Convert 2 RHEL, set to , and then click .
On the page, set to convert2rhel and set to yes.
Click to skip to the last page.
Review the parameters on the page. After confirming all settings, click to start the conversion to RHEL 7.
Wait for the machine to reboot.
The jobs that are assigned to the host take some time to run. After the host is provisioned, it takes around five minutes for the job to be scheduled, run, and completed on the host.
You can review the status of the jobs in the Satellite web UI by selecting → → from the main menu.
Confirm that the serverb host is converted to RHEL 7.
Log in to the serverb machine as the student user and review the operating system version of the serverb host.
[student@workstation ~]$ssh serverbstudent@serverb's password:student[student@serverb ~]$cat /etc/redhat-releaseRed Hat Enterprise Linux Server release 7.9 (Maipo)
Exit the serverb machine.
[student@serverb ~]$ exit
logout
Connection to serverb closed.