Chapter 12. Managing system upgrades as snapshots

As a system administrator, use Boom to create boot entries for alternative copies of the system state. Boom simplifies the management of system updates.

Warning

The procedures mentioned in this chapter does not work on multiple file systems in your system tree.

12.1. Overview of the Boom process

Boom allows to create boot entries, which can then be accessed and selected from the GRUB 2 boot loader menu. By creating boot entries, the process of preparing for a rollback capable upgrade is now simplified.

Rollback-capable upgrades are done using the following process without editing any configuration files:

  1. Create a snapshot or copy of the root file system.
  2. Use Boom to create a boot entry for the current (older) environment.
  3. Upgrade your Red Hat Enterprise Linux system.
  4. Reboot the system, and select the version that you want to use.

Using Boom reduces the risks associated with upgrading a system and also helps to reduce hardware downtime.

For example, you can upgrade a Red Hat Enterprise Linux 7 system to Red Hat Enterprise Linux 8, while retaining the original Red Hat Enterprise Linux 7 environment. After the upgrade is complete, you can switch between the old Red Hat Enterprise Linux 7 and new Red Hat Enterprise Linux 8 environments, as needed.

This ability to switch between environments allows you to:

  • Quickly compare both environments in a side-by-side fashion and switch between them with minimal overhead.
  • Recover the older file system’s content.
  • 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.

Additional resources

  • The boom man page.

12.2. Upgrading to another version using Boom

In addition to Boom, the following Red Hat Enterprise Linux components are used in this upgrade process:

  • LVM
  • GRUB 2 boot loader
  • Leapp upgrade tool

This procedure describes how to upgrade from Red Hat Enterprise Linux 7 to Red Hat Enterprise Linux 8 using the boom package.

Prerequisites

  • Install the boom package:

    # yum install lvm2-python-boom
  • Sufficient space allocated to the snapshot. Use the following commands to find the free space on the volume groups and logical volumes:

    # vgs
    VG  #PV  #LV  #SN  Attr  VSize    VFree
    rhel 4 2 0 wz--n- 103.89g 29.99g
    
    # lvs
    LV     VG    Attr     LSize  Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    root rhel -wi-ao--- 68.88g
    swap rhel -wi-ao--- 5.98g

Procedure

  1. Create a snapshot of your root logical volume:

    • If your root file system uses thin provisioning, create a thin snapshot:

      While creating a thin snapshot, do not define the snapshot size. Snapshot is also allocated from the thin pool.

      # lvcreate -s -k n rhel/root -n root_snapshot_before_changes

      Here:

      • -s is used to create the snapshot
      • rhel/root is the file system being copied in the logical volume
      • -n root_snapshot_before_changes is the name of the snapshot
      • -k n is used to not skip the activation because thin snapshots are not activated by default
    • If your root file system uses thick provisioning, create a thick snapshot:

      While creating a thick snapshot, define the snapshot size that is able to hold all the changes during the upgrade.

      # lvcreate -s  rhel/root -n root_snapshot_before_changes -L 25g

      Here:

      • -s is used to create the snapshot
      • rhel/root is the file system being copied
      • -n root_snapshot_before_changes is the name of the snapshot
      • -L 25g is the snapshot size that is able to hold all the changes during the upgrade

        Important

        After creating the snapshot, any additional system changes are not included.

  2. Create the profile:

    # boom profile create --from-host --uname-pattern el8
  3. Create a new boot entry:

    # boom create --title "Root LV snapshot before changes" --rootlv rhel/root_snapshot_before_changes

    Here:

    • --title Root LV snapshot before changes is the name of the boot entry, which displays in the list during system startup
    • --rootlv is the root logical volume that corresponds to the new boot entry

      If you execute the boom create command for the first time, the following message displays:

      WARNING - Boom configuration not found in grub.cfg
      
      WARNING - Run 'grub2-mkconfig > /boot/grub2/grub.cfg' to enable

      To enable Boom in GRUB 2:

      # grub2-mkconfig > /boot/grub2/grub.cfg
  4. Upgrade using Leapp:

    # leapp upgrade --reboot
    Note

    The reboot argument initiates an automatic system restart after the upgrade process.

    During reboot, the GRUB 2 screen is displayed:

    GRUB2 display
  5. Select the RHEL Upgrade Initramfs entry and press ENTER. The upgrade continues and new Red Hat Enterprise Linux 8 RPM packages are installed. After the upgrade is complete, the system automatically reboots and the GRUB 2 screen displays the upgraded and the older version of the available system. The upgraded system version is the default selection.

    switching between new and old versions

Additional resources

12.3. Switching between new and old Red Hat Enterprise Linux versions

This procedure describes steps to switch between the new and the old Red Hat Enterprise Linux versions after the upgrade is complete.

Prerequisites

Procedure

  1. Reboot the system:

    # reboot
  2. Select the desired boot entry from the GRUB 2 boot loader screen.

    switching between new and old versions
  3. Verify that the selected boot volume is displayed:

    # boom list

Additional resources

  • The boom man page.

12.4. Deleting the snapshot

This procedure describes steps to delete the snapshot.

Prerequisites

Procedure

  1. Boot into Red Hat Enterprise Linux 8 from the GRUB 2 entry. The following output confirms that the new snapshot is selected:

    # boom list
    BootID  Version                    Name                            RootDevice
    6d2ec72 3.10.0-957.21.3.el7.x86_64 Red Hat Enterprise Linux Server /dev/rhel/root_snapshot_before_changes
  2. Delete the Boom snapshot entry using the BootID value:

    # boom delete --boot-id 6d2ec72

    This deletes the entry from the GRUB 2 menu.

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

    Additional resources

    • The boom man page.