Skip to main content

RHEL 7 to RHEL 9 in-place upgrade

2 min read
#rhel #leapp #linux #hyper-v #vmware

Leapp upgrade from RHEL 7 to RHEL 8 to RHEL 9

Overview

This project upgrades RHEL 7 virtual machines to RHEL 9 in place, without rebuilding them. The upgrade happens in two stages, RHEL 7 to 8 and then RHEL 8 to 9, and the same procedure works on Hyper-V and VMware.

The main problem it solves is a VM that won’t boot after the upgrade. A VM cloned from a template can still have the template’s volume group name in its boot settings, so it stops at the dracut prompt. The procedure checks for this before the upgrade starts.

Tools used

  • Leapp: checks the system for problems and runs each upgrade
  • grubby: checks and fixes the boot settings
  • LVM: shows the real volume group names to compare with the boot settings
  • dracut: rebuilds the initramfs, the small image that starts the system
  • Hyper-V checkpoints and VMware snapshots: a way back if an upgrade fails

How it works

Both stages follow the same order:

  1. Take a checkpoint or snapshot
  2. Update the system and check that the boot settings match the LVM names
  3. Run the Leapp pre-upgrade check and fix anything that blocks the upgrade
  4. Run the upgrade and check that the storage driver is in the upgrade image
  5. Reboot, and recover from the console if the VM stops at the dracut prompt
  6. Check the boot settings and rebuild the initramfs

After RHEL 9 is running, the last steps remove old packages, rebuild the rescue kernel and delete the checkpoint or snapshot.

Step-by-step guide

All the commands are in my note: Upgrade RHEL 7 to RHEL 9 with Leapp.