Search

Chapter 10. Managing system upgrades with snapshots

download PDF

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 /var or /usr partition.
  • 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).

10.1. Overview of the Boom process

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 entry

    Boots the Leapp upgrade environment. Use the leapp utility to create and manage this boot entry. The leapp upgrade process automatically removes this entry.

  • Red Hat Enterprise Linux 9 boot entry

    Boots the upgrade system environment. Use the leapp utility to create this boot entry after a successful upgrade process.

  • Snapshot boot entry

    Boots 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 boom command to create this boot entry.

  • Rollback boot entry

    Boots the original system environment and rolls back any upgrade to the previous system state. Use the boom command to create this boot entry when initiating a rollback of the upgrade procedure.

Additional resources

  • boom(1) man page

10.2. Upgrading to another version using Boom Boot Manager

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 8.8 or 8.10.
  • You have installed the current version of the boom-boot package (version boom-boot-1.3-2.el8 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 leapp package.
  • You have enabled software repositories.
Note

Additional file systems might include /usr or /var.

Procedure

  1. 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.

      Here:

      • -s creates the snapshot.
      • rhel/root copies the file system to the logical volume.
      • -kn automatically activates LV at boot time.
      • -n root_snapshot_before_changes shows 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
        Rounding up size to full physical extent 25 GiB
        Logical volume "root_snapshot_before_changes" created.

      In this command:

      • -s creates the snapshot.
      • rhel/root copies the file system to the logical volume.
      • -n root_snapshot_before_changes shows the name of the snapshot.
      • -L 25g is 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.

        Important

        The created snapshot does not include any additional system changes.

  2. Create the profile:

    Creating a profile requires an architecture-specific workaround to avoid an interaction between kexec-tools or kdumpctl and boom. During the upgrade, the updated kexec-tools package attempts to modify all boot entries with updated crashkernel settings. This deletes the boot images used by the entry. You can avoid this by appending the RHEL 9 crashkernel settings to the RHEL 8 profile options.

    • On an Intel 64 or AMD64 (x86_64), or IBM Z (s390x) architecture:

      # boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
      Created profile with os_id 43747d3:
        OS ID: "43747d3888b663d2bc88efd35d0813159a84d291",
        Name: "Red Hat Enterprise Linux", Short name: "rhel",
        Version: "8.9 (Ootpa)", Version ID: "8.9",
        Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
        Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
        Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
        Options: "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M",
        Title: "%{os_name} %{os_version_id} (%{version})",
        Optional keys: "", UTS release pattern: "el8"
    • On an 64-bit ARM (AArch64) architecture:

      # boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=1G-4G:256M,4G-64G:320M,64G-:576M"
    • On an IBM POWER little-endian (ppc64le) architecture:

      # boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G" --optional-keys "grub_users grub_arg grub_class id"

      The --optional-keys argument is required on ppc64le to ensure that the grub2-mkconfig command generates the correct boot entry in step 10.2.3. For more information, see RHEL-36180.

  3. Create a snapshot boot entry of the original system using backup copies of the original boot images:

    # boom create --backup --title "Root LV snapshot before changes" --rootlv rhel/root_snapshot_before_changes
    WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
    Created entry with boot_id c919f89:
      title Root LV snapshot before changes
      machine-id b1dcec73886b45218892b1a7bbfa0dee
      version 4.18.0-513.24.1.el8_9.x86_64
      linux /vmlinuz-4.18.0-513.24.1.el8_9.x86_64.boom0
      initrd /initramfs-4.18.0-513.24.1.el8_9.x86_64.img.boom0
      options root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M

    Here:

    • --title "Root LV snapshot before changes" is the name of the boot entry, that shows in the boot entry list during system startup.
    • --rootlv is 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.

      Ignore "WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'". For details, see RHEL-35983.

    • On systems with ppc64le architecture, update boot entries:

      # grub2-mkconfig -o /boot/grub2/grub.cfg
      Generating grub configuration file ...
      Generating boot entries from BLS files...
      done
  4. Upgrade to Red Hat Enterprise Linux 9 using the Leapp utility:

    # leapp upgrade
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    ...
    ============================================================
                          REPORT OVERVIEW
    ============================================================
    
    Upgrade has been inhibited due to the following problems:
        1. Firewalld Configuration AllowZoneDrifting Is Unsupported
        2. Possible problems with remote login using root account
    
    HIGH and MEDIUM severity reports:
        1. Remote root logins globally allowed using password
        2. GRUB2 core will be automatically updated during the upgrade
    
    Reports summary:
        Errors:                      0
        Inhibitors:                  2
        HIGH severity reports:       2
        MEDIUM severity reports:     0
        LOW severity reports:        1
        INFO severity reports:       3
    
    Before continuing consult the full report:
        A report has been generated at /var/log/leapp/leapp-report.json
        A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                       END OF REPORT OVERVIEW
    ============================================================

    Review and resolve any blockers indicated by the leapp upgrade command report. For detailed instructions on the report, see Reviewing the pre-upgrade report.

  5. Reboot into the upgrade boot entry:

    # leapp upgrade --reboot
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    ...

    Select the Red Hat Enterprise Linux Upgrade Initramfs entry from the GRUB boot screen.

    Note

    The Snapshots submenu from the GRUB boot screen is not available in Red Hat Enterprise Linux 9.

Verification

  • After completing the upgrade, the system automatically reboots. The GRUB screen shows the upgraded (Red Hat Enterprise Linux 9) and the previous version of the available operating system. The upgraded system version is the default selection.

10.3. Switching between Red Hat Enterprise Linux versions

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

  1. Reboot the system:

    # reboot
  2. 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-4.18.0-513.24.1.el8_9.x86_64.boom0 root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M

Additional resources

  • boom(1) man page

10.4. Deleting the logical volume snapshot after a successful upgrade

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.

Important

You cannot perform any further operations with the LV snapshot after you delete it.

Prerequisites

Procedure

  1. Boot into Red Hat Enterprise Linux 9 from the GRUB boot loader screen.
  2. After the system loads, view the available boot entries. The following output shows the snapshot boot entry in the list of boom boot entries:

    # boom list
    BootID  Version                      Name                     RootDevice
    1e1a9b4 4.18.0-513.5.1.el8_9.x86_64  Red Hat Enterprise Linux /dev/mapper/rhel-root
    4ea37b9 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root
    c919f89 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/rhel/root_snapshot_before_changes
  3. Delete the snapshot entry by using the BootID value:

    # boom delete --boot-id c919f89
    Deleted 1 entry

    This deletes the boot entry from the GRUB menu.

  4. 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
  5. Complete the remaining post-upgrade tasks. For details, see Upgrading from RHEL 8 to RHEL 9.

Additional resources

  • boom(1) man page

10.5. Creating a rollback boot entry after an unsuccessful upgrade

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

Procedure

  1. 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.
    Warning

    After you merge the snapshot, you must continue with all the remaining steps in this procedure to prevent data loss.

  2. Create a rollback boot entry for the merged snapshot:

    # boom create --backup --title "RHEL Rollback" --rootlv rhel/root
    WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
    WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=e22dd61) do not match OsProfile: marking read-only
    Created entry with boot_id 6c44638:
      title RHEL Rollback
      machine-id b1dcec73886b45218892b1a7bbfa0dee
      version 4.18.0-513.24.1.el8_9.x86_64
      linux /vmlinuz-4.18.0-513.24.1.el8_9.x86_64.boom0
      initrd /initramfs-4.18.0-513.24.1.el8_9.x86_64.img.boom0
      options root=/dev/rhel/root ro rd.lvm.lv=rhel/root rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M

    Ignore all WARNING messages, see RHEL-35983.

  3. Reboot your machine to restore the operating system state:

    # reboot
    • After the system reboots, select the RHEL Rollback boot entry from the GRUB screen.
    • When the root logical volume is active, the system automatically starts the snapshot merge operation.

      Important

      When 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.

  4. After you complete the merge operation, remove the unused entries and restore the original boot entry:

    1. Remove the unused Red Hat Enterprise Linux 9 boot entries from the /boot file system and rebuild the grub.cfg file for the changes to take effect:

      # rm -f /boot/loader/entries/*.el9*
      # rm -f /boot/*.el9*
      # grub2-mkconfig -o /boot/grub2/grub.cfg
      Generating grub configuration file ...
      done
  5. After a successful rollback to the system, delete the boom snapshot and rollback boot entries:

    # boom list -o+title
    WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only
    BootID  Version                      Name                     RootDevice                             Title
    1e1a9b4 4.18.0-513.5.1.el8_9.x86_64  Red Hat Enterprise Linux /dev/mapper/rhel-root                  Red Hat Enterprise Linux (4.18.0-513.5.1.el8_9.x86_64) 8.9 (Ootpa)
    4ea37b9 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root                  Red Hat Enterprise Linux (4.18.0-513.24.1.el8_9.x86_64) 8.9 (Ootpa)
    c919f89 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/rhel/root_snapshot_before_changes Root LV snapshot before changes
    6c44638 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/rhel/root                         RHEL Rollback
    # boom delete c919f89
    WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only
    Deleted 1 entry
    # boom delete 6c44638
    WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only
    WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only
    Deleted 1 entry

    Ignore the warnings. For details, see RHEL-35983.

Additional resources

  • boom(1) man page
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.