Linux · July 23, 2025

How to Perform an In-Place Upgrade for RHEL PAYG Hong Kong Cloud Server Using Leapp

**Background and Key Considerations**
Upgrading RHEL systems is critical for accessing new features, security updates, and support. Research confirms that in-place upgrades using the Leapp tool are feasible but carry the following risks:
– **VM Disruption**: The upgrade process disconnects the VM’s data plane from the control plane, impacting Azure functionalities (e.g., Automatic Guest Patching, Automatic OS Image Upgrades, Hot Patching, and Azure Update Manager).
– **Recommended Approach**: To retain these features, deploy a new VM instead of performing an in-place upgrade, especially in feature-dependent scenarios.
– **Scope**: This guide applies to Linux VMs using RHEL PAYG images.

> **Note**: Red Hat Update Infrastructure (RHUI) supports only PAYG images. For custom/golden images (BYOS), attach the system to Red Hat Subscription Manager (RHSM) or Satellite for updates. This document focuses on PAYG environments.


Prerequisites
Before upgrading, ensure:
– **Backup**: Snapshot the OS disk or back up the Linux VM to prevent data loss.
– **Disk Space**: Ensure ≥2-5 GB free space in `/var/lib/leapp`.
– **Serial Console Access**: Configure serial console access to mitigate network disruptions.
– **Permissions**: Run all commands with `root` privileges.

Preparing the Hong Kong VPS
Example: Upgrading from RHEL 7.9 to RHEL 8.x (similar steps apply for RHEL 8.x → 9.x with adjusted repositories/target versions). Supported paths:

| Source OS | Target Version | End of Support |
|—————|—————-|———————-|
| RHEL 7.9 | RHEL 8.8 | May 31, 2025 (EUS) |
| RHEL 7.9 | RHEL 8.10 | June 30, 2028 |

Step-by-Step Procedure
1. **Release Version Lock**
– Remove minor-version locks if applicable. Refer to docs for exiting EUS mode.
“`bash
sudo yum versionlock clear
“`

2. **Enable RHUI Repositories and Install Packages**
“`bash
sudo yum-config-manager –enable rhui-microsoft-azure-rhel7
sudo yum -y install rhui-azure-rhel7
sudo yum-config-manager –enable rhui-rhel-7-server-rhui-extras-rpms
sudo yum -y install leapp-rhui-azure
“`

3. **Install Leapp**
“`bash
sudo yum install leapp-upgrade
“`

4. **Update Packages and Reboot**
“`bash
sudo yum update
sudo reboot
“`

5. **Pre-Upgrade Preparation**
– Temporarily disable antivirus software and configuration management systems (e.g., Puppet, Ansible).

Leapp Pre-Upgrade Process
The pre-upgrade report identifies potential issues and solutions.
– Run the pre-upgrade check:
“`bash
sudo leapp preupgrade –target <target_os_version> –no-rhsm # e.g., –target 8.10
“`
– Review `/var/log/leapp/leapp-report.txt`. Resolve all inhibitors (blocking issues) before proceeding.

Leapp Upgrade Process
Proceed if the pre-upgrade report shows no errors/inhibitors (green/yellow output).
> **Critical**: Execute via serial console to avoid SSH disruptions.
“`bash
sudo leapp upgrade –target <target_os_version> –no-rhsm
“`
– Add `–reboot` for auto-reboot, or manually reboot:
“`bash
sudo reboot
“`

Post-Upgrade Verification
– Check OS version:
“`bash
sudo cat /etc/redhat-release
“`
– Verify kernel:
“`bash
uname -r
“`
– Confirm repositories:
“`bash
sudo dnf repolist
“`

Post-Upgrade Cleanup
1. Remove Leapp package exclusions:
“`bash
sudo dnf config-manager –save –setopt exclude=”
“`
2. Remove residual RHEL 7 packages:
“`bash
sudo dnf remove $(rpm -qa | grep \.el[67] | grep -vE ‘gpg-pubkey|libmodulemd|katello-ca-consumer’)
“`
3. Clear weak modules from old kernels:
“`bash
sudo [ -x /usr/sbin/weak-modules ] && sudo /usr/sbin/weak-modules –remove-kernel <kernel_version>
“`
4. Delete old kernel entries:
“`bash
sudo /bin/kernel-install remove <kernel_version> /lib/modules/<kernel_version>/vmlinuz
“`
5. Purge remaining RHEL 7 packages:
“`bash
sudo yum remove kernel-workaround $(rpm -qa | grep \.el7 | grep -vE ‘gpg-pubkey|libmodulemd|katello-ca-consumer’)
“`
6. Remove Leapp dependencies:
“`bash
sudo yum remove leapp-deps-el8 leapp-repository-deps-el8 leapp-rhui-azure
“`
7. Delete empty directories:
“`bash
sudo rm -r /lib/modules/*el7*
“`
8. (Optional) Remove upgrade data:
“`bash
sudo rm -rf /var/log/leapp /root/tmp_leapp_py3 /var/lib/leapp
“`

Troubleshooting and FAQs
– **`subscription-manager` Errors**: For PAYG, use `–no-rhsm` in Leapp commands.
– **RHEL 8 User-Space Package Failures**: Verify target repositories (RHUI/RHSM).
– **Root Remote Login Issues**: Ensure SSH permits `root` login if inhibited.
– **General Errors**: Check `/var/log/leapp/leapp-report.txt` and `/var/log/leapp/leapp-upgrade.log`.


Additional Notes
– **SAP Workloads**: SAP-HANA/SAP-APPS PAYG VMs have extra requirements. Consult dedicated documentation.
– **Leapp Limitations**:
– No support for full-disk/partition encryption.
– No support for network-based multipathing or FCoE storage.
– **Testing**: Validate upgrades in a non-production environment (e.g., Hong Kong  VPS) first.


> For detailed troubleshooting, refer to Red Hat’s OS upgrade documentation.