Bookmark this page

Guided Exercise: Perform a Conversion to RHEL by using Red Hat Satellite

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

  1. On the Satellite Server console, configure the Ansible Role to convert the serverb machine to RHEL 7.

    1. 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 Advanced, and then click Add Exception. Click Confirm Security Exception to accept the self-signed certificate.

      Log in as the admin user with redhat as the password.

    2. In the Organization 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 Organization drop-down list and select Operations. Click the Location drop-down list and select Any Location.

    3. Select ConfigureAnsibleRoles from the main menu, and then click Import from satellite.lab.example.com.

      Search for the redhat.satellite.convert2rhel role and select it. Click Submit.

    4. Select ConfigureAnsibleVariables from the main menu, and then click New Ansible Variable. Use the following parameters to create variables for the redhat.satellite.convert2rhel role.

      Use the variable name as Key, the variable type as Parameter Type, and the variable value as Default Value. For all variables, select redhat.satellite.convert2rhel as the Ansible Role and select the Override checkbox. Click Submit after you finish entering the information of a variable to create it. Repeat the process to create each variable in the table.

      Variable NameVariable TypeVariable 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
    5. On the ConfigureAnsibleVariables page, search for the satellite_convert2rhel_manage_subscription variable and click it. Select the Override checkbox and set the Default Value field to False. Click Submit.

      Important

      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.

  2. Verify the Satellite Server configuration to convert the serverb machine to RHEL 7.

    1. Select ContentLifecycleContent Views from the main menu, and then click convert2rhel.

      On the Repositories 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

    2. Select ContentLifecycleActivation Keys from the main menu, and then click convert2rhel.

      On the Repository Sets tab, select the checkbox for each of the following repositories:

      • CentOS-7-os

      • CentOS-updates

      • convert2rhel-for-rhel-7-rpms

        Click Select Action and select Override to Enabled.

  3. Register the serverb system to the Operations organization by using the convert2rhel activation key.

    1. Log in to the serverb machine as the student user. Switch to the root user. Use student as the password.

      [student@workstation ~]$ ssh serverb
      student@serverb's password: student
      [student@serverb ~]$ sudo -i
      [sudo] password for student: student
      [root@serverb ~]#
    2. 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!
    3. Register the serverb host to Satellite Server by using the convert2rhel activation key.

      [root@serverb ~]# subscription-manager register \
      --activationkey convert2rhel \
      --org Operations
      The system has been registered with ID: 4beee245-ed55-4562-b15b-d9b88230099c
      The registered system name is: serverb
  4. Configure the serverb host to allow remote execution by Satellite Server.

    1. 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: redhat
      Number of key(s) added: 1
      ...output omitted...
    2. 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 ~]#
  5. Prepare the serverb host for conversion to RHEL 7.

    Important

    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.

    1. Exit the open sessions on the second terminal tab and close it.

      [root@serverb ~]# exit
      logout
      [root@satellite ~]# exit
      logout
      [student@satellite ~]$ exit
      logout
    2. 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)
    3. Update the serverb machine's packages.

      [root@serverb ~]# yum update
      ...output omitted...
      Is this ok [y/d/N]: y
      ...output omitted...
      Complete!
    4. 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 ~]$
  6. Use Satellite Server to convert the serverb machine to RHEL 7.

    1. On the web UI, verify that the serverb host is registered with the Operations organization and schedule the conversion to RHEL 7.

      Click HostsAll Hosts, and confirm that the serverb.lab.example.com host is listed as a CentOS 7 system.

    2. Select the checkbox for the serverb.lab.example.com host. Click Select Action and select Schedule Remote Job. Selecting this action starts a sequence of five Run job pages to configure the remote job that converts the system to RHEL.

    3. On the Category and template page, set Job category to Convert 2 RHEL, set Job template to Convert to RHEL, and then click Next.

    4. On the Targets hosts and inputs page, set Activation Key to convert2rhel and set Restart to yes. Click Skip to review to skip to the last Run job page.

    5. Review the parameters on the Review details page. After confirming all settings, click Submit to start the conversion to RHEL 7.

      Wait for the machine to reboot.

      Note

      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 MonitorMonitorJobs from the main menu.

  7. 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 serverb
    student@serverb's password: student
    [student@serverb ~]$ cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 7.9 (Maipo)
  8. Exit the serverb machine.

    [student@serverb ~]$ exit
    logout
    Connection to serverb closed.

Finish

On the workstation machine, use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish convert-satellite

Revision: rh174-7.9-0acf85c