Chapter 6. Managing system upgrades with snapshots
Perform rollback capable upgrades of Red Hat Enterprise Linux systems to return to an earlier version of the operating system. You can use the Boom Boot Manager and the Leapp operating system modernization framework.
Before performing the operating system upgrades, consider the following aspects:
-
System upgrades with snapshots do not work on multiple file systems in your system tree, for example, a separate
/varor/usrpartition. - System upgrades with snapshots do not work for the Red Hat Update Infrastructure (RHUI) systems. Instead of using the Boom utility, consider creating snapshots of your virtual machines (VMs).
6.1. Overview of the Boom process Copiar enlaceEnlace copiado en el portapapeles!
Create boot entries using the Boom Boot Manager so you can select and access these entries from the GRUB boot loader menu. Creating boot entries simplifies the process of preparation for a rollback capable upgrade.
The following boot entries are part of the upgrade and rollback processes:
Upgrade boot entryBoots the Leapp upgrade environment. Use the
leapputility to create and manage this boot entry. Theleappupgrade process automatically removes this entry.Red Hat Enterprise Linux 8 boot entryBoots the upgrade system environment. Use the
leapputility to create this boot entry after a successful upgrade process.Snapshot boot entryBoots the snapshot of the original system. Use it to review and test the previous operating system state, following a successful or unsuccessful upgrade attempt. Before upgrading the operating system, use the
boomcommand to create this boot entry.Rollback boot entryBoots the original system environment and rolls back any upgrade to the previous system state. Use the
boomcommand to create this boot entry when initiating a rollback of the upgrade procedure.
6.2. Upgrading to another version using Boom Boot Manager Copiar enlaceEnlace copiado en el portapapeles!
Perform an upgrade of your Red Hat Enterprise Linux operating system by using the Boom Boot Manager.
Prerequisites
- You are running Red Hat Enterprise Linux 7.9.
-
You have installed the current version of the
lvm2-python-boompackage (version lvm2-python-boom-1.2-2.el7_9.5 or later). - You have sufficient space available for the snapshot. Make a size estimate based on the size of the original installation. List all the mounted logical volumes.
-
You have installed the
leapppackage. - You have enabled software repositories.
Additional file systems might include /usr or /var.
Procedure
Create a snapshot of your root logical volume:
If your root file system uses thin provisioning, create a thin snapshot:
lvcreate -s rhel/root -kn -n root_snapshot_before_changes Logical volume "root_snapshot_before_changes" created.
# lvcreate -s rhel/root -kn -n root_snapshot_before_changes Logical volume "root_snapshot_before_changes" created.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Here:
-
-screates the snapshot. -
rhel/rootcopies the file system to the logical volume. -
-knautomatically activates LV at boot time. -n root_snapshot_before_changesshows the name of the snapshot.While creating a thin snapshot, do not define the snapshot size. The snapshot is allocated from the thin pool.
-
If your root file system uses thick provisioning, create a thick snapshot:
lvcreate -s rhel/root -n root_snapshot_before_changes -L 25g Logical volume "root_snapshot_before_changes" created.
# lvcreate -s rhel/root -n root_snapshot_before_changes -L 25g Logical volume "root_snapshot_before_changes" created.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command:
-
-screates the snapshot. -
rhel/rootcopies the file system to the logical volume. -
-n root_snapshot_before_changesshows the name of the snapshot. -L 25gis the snapshot size. Make a size estimate based on the size of the original installation.While creating a thick snapshot, define the snapshot size that can hold all the changes during the upgrade.
ImportantThe created snapshot does not include any additional system changes.
-
Enable
boomby using the GRUB boot loaderCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the profile:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a snapshot boot entry of the original system using backup copies of the original boot images:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Here:
-
--title "Root LV snapshot before changes"is the name of the boot entry, that shows in the boot entry list during system startup. --rootlvis the root logical volume that corresponds to the new boot entry.After you complete the previous step, you have a boot entry that enables access to the original system, before the upgrade.
-
Upgrade to Red Hat Enterprise Linux 8 using the Leapp utility:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Review and resolve any blockers indicated by the
leapp upgradecommand report. For detailed instructions on the report, see Assessing upgradability from the command line.Reboot into the upgrade boot entry:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Select the Red Hat Enterprise Linux Upgrade Initramfs entry from the GRUB boot screen.
NoteThe Snapshots submenu from the GRUB boot screen is not available in Red Hat Enterprise Linux 8.
Verification
- After completing the upgrade, the system automatically reboots. The GRUB screen shows the upgraded (Red Hat Enterprise Linux 8) and the previous version of the available operating system. The upgraded system version is the default selection.
6.3. Switching between Red Hat Enterprise Linux versions Copiar enlaceEnlace copiado en el portapapeles!
Access simultaneously current and previous Red Hat Enterprise Linux versions on your machine. Using the Boom Boot Manager to access different operating system versions reduces the risk associated with upgrading an operating system, and also helps reduce hardware downtime. With this ability to switch between environments, you can:
- Quickly compare both environments in a side-by-side fashion.
- Switch between environments while evaluating the result of the upgrade.
- Recover older content of the file system.
- Continue accessing the old system, while the upgraded host is running.
- Halt and revert the update process at any time, even while the update itself is running.
Procedure
Reboot the system:
reboot
# rebootCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Select the required boot entry from the GRUB boot loader screen.
Verification
Verify that the selected boot volume is displayed:
cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-3.10.0-1160.118.1.el7.x86_64.boom0 root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes
# cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-3.10.0-1160.118.1.el7.x86_64.boom0 root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Deleting the logical volume snapshot after a successful upgrade Copiar enlaceEnlace copiado en el portapapeles!
If you have successfully upgraded your system by using the Boom Boot Manager, you can remove the snapshot boot entry and the logical volume (LV) snapshot to use the upgraded system.
You cannot perform any further operations with the LV snapshot after you delete it.
Prerequisites
- You have recently upgraded your Red Hat Enterprise Linux to a later version by using the Boom Boot Manager.
Procedure
- Boot into Red Hat Enterprise Linux 8 from the GRUB boot loader screen.
After the system loads, view the available boot entries. The following output shows the snapshot boot entry in the list of boom boot entries:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The warning is expected, you cannot change or delete these entries by using boom because the
kernelandgrubbypackages manage them.Delete the snapshot entry by using the
BootIDvalue:boom delete --boot-id e0252ad Deleted 1 entry
# boom delete --boot-id e0252ad Deleted 1 entryCopy to Clipboard Copied! Toggle word wrap Toggle overflow This deletes the boot entry from the GRUB menu.
Remove the LV snapshot:
lvremove rhel/root_snapshot_before_changes Do you really want to remove active logical volume rhel/root_snapshot_before_changes? [y/n]: y Logical volume "root_snapshot_before_changes" successfully removed# lvremove rhel/root_snapshot_before_changes Do you really want to remove active logical volume rhel/root_snapshot_before_changes? [y/n]: y Logical volume "root_snapshot_before_changes" successfully removedCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Complete the remaining post-upgrade tasks. For details, see Upgrade from RHEL 7 to RHEL 8.
6.5. Creating a rollback boot entry after an unsuccessful upgrade Copiar enlaceEnlace copiado en el portapapeles!
To revert the operating system upgrade back to the previous state of the system after an unsuccessful upgrade, use a rollback boot entry. This can also be helpful if you find a problem with the upgraded environment, for example, incompatibility with in-house software.
To prepare the rollback boot entry, use the snapshot environment.
Prerequisites
- You have a snapshot. For instructions for creating a snapshot, see Upgrading to another version using Boom boot manager.
Procedure
Merge the snapshot with the original volume:
lvconvert --merge rhel/root_snapshot_before_changes Logical volume rhel/root_snapshot_before_changes contains a filesystem in use. Delaying merge since snapshot is open. Merging of thin snapshot rhel/root_snapshot_before_changes will occur on next activation of rhel/root.
# lvconvert --merge rhel/root_snapshot_before_changes Logical volume rhel/root_snapshot_before_changes contains a filesystem in use. Delaying merge since snapshot is open. Merging of thin snapshot rhel/root_snapshot_before_changes will occur on next activation of rhel/root.Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningAfter you merge the snapshot, you must continue with all the remaining steps in this procedure to prevent data loss.
Create a rollback boot entry for the merged snapshot:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reboot your machine to restore the operating system state:
reboot
# rebootCopy to Clipboard Copied! Toggle word wrap Toggle overflow - After the system reboots, select the RHEL Rollback boot entry from the GRUB screen.
When the
rootlogical volume is active, the system automatically starts the snapshot merge operation.ImportantWhen the merge operation starts, the snapshot volume is no longer available. After successfully booting the RHEL Rollback boot entry, the Root LV snapshot boot entry no longer works. Merging the snapshot logical volume destroys the Root LV snapshot and restores the prior state of the original volume.
After you complete the merge operation, remove the unused entries and restore the original boot entry:
Remove the unused Red Hat Enterprise Linux 8 boot entries from the
/bootfile system and rebuild thegrub.cfgfile for the changes to take effect:rm -f /boot/loader/entries/*.el8*
# rm -f /boot/loader/entries/*.el8*Copy to Clipboard Copied! Toggle word wrap Toggle overflow rm -f /boot/*.el8*
# rm -f /boot/*.el8*Copy to Clipboard Copied! Toggle word wrap Toggle overflow grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-1160.118.1.el7.x86_64.boom0 .... done
# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-1160.118.1.el7.x86_64.boom0 .... doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the original Red Hat Enterprise Linux boot entry:
new-kernel-pkg --update $(uname -r)
# new-kernel-pkg --update $(uname -r)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After a successful rollback to the system, delete the
boomsnapshot and rollback boot entries:Copy to Clipboard Copied! Toggle word wrap Toggle overflow boom delete e0252ad Deleted 1 entry boom delete 1e6d298 Deleted 1 entry
# boom delete e0252ad Deleted 1 entry # boom delete 1e6d298 Deleted 1 entryCopy to Clipboard Copied! Toggle word wrap Toggle overflow