Bug 2222818

Summary: boom default read-only boot entries don't exist on virt machines
Product: Red Hat Enterprise Linux 9 Reporter: Corey Marthaler <cmarthal>
Component: boom-bootAssignee: LVM and device-mapper development team <lvm-team>
Status: CLOSED NOTABUG QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.3CC: agk, bmr, jbrassow, mcsontos
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-19 17:34:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2023-07-13 21:10:57 UTC
Description of problem:
# phys machine

[root@grant-01 ~]# df
Filesystem                      1K-blocks    Used Available Use% Mounted on
devtmpfs                             4096       0      4096   0% /dev
tmpfs                           131526800       0 131526800   0% /dev/shm
tmpfs                            52610720  518672  52092048   1% /run
/dev/mapper/rhel_grant--01-root  73334784 5786304  67548480   8% /
/dev/mapper/rhel_grant--01-home 390014912 2752456 387262456   1% /home
/dev/sda1                          983040  310388    672652  32% /boot
tmpfs                            26305360      36  26305324   1% /run/user/0

[root@grant-01 ~]# lvs -a -o +devices
  LV   VG            Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices         
  home rhel_grant-01 -wi-ao---- <372.13g                                                     /dev/sda2(1024) 
  root rhel_grant-01 -wi-ao----   70.00g                                                     /dev/sda2(96289)
  swap rhel_grant-01 -wi-ao----    4.00g                                                     /dev/sda2(0)    

[root@grant-01 ~]# pvscan
  PV /dev/sda2   VG rhel_grant-01   lvm2 [<446.13 GiB / 0    free]
  Total: 1 [<446.13 GiB] / in use: 1 [<446.13 GiB] / in no VG: 0 [0   ]

[root@grant-01 ~]# boom list
BootID  Version                  Name                     RootDevice                     
6aa5654 5.14.0-322.el9.x86_64    Red Hat Enterprise Linux /dev/mapper/rhel_grant--01-root
50ee40b 5.14.0-322.el9.x86_64    Red Hat Enterprise Linux /dev/mapper/rhel_grant--01-root


[root@grant-01 ~]# ls -l /boot/loader/entries
total 12
-rw-r--r--. 1 root root 522 Jul 13 21:07 7b2d82dad70f4ece8f867b6a482308de-0-rescue.conf
-rw-r--r--. 1 root root 456 Jul 13 21:07 7b2d82dad70f4ece8f867b6a482308de-5.14.0-322.el9.x86_64.conf
-rw-r--r--. 1 root root 537 Jul 13 21:07 7b2d82dad70f4ece8f867b6a482308de-cd14f03-5.14.0-322.el9.x86_64.conf




# virt machine

[root@virt-552 ~]# yum install boom-boot lvm2-dbusd sanlock
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:44:56 ago on Thu 13 Jul 2023 10:10:43 PM CEST.
Dependencies resolved.
============================================================================================================================================================================================================
 Package                                           Architecture                              Version                                              Repository                                           Size
============================================================================================================================================================================================================
Installing:
 boom-boot                                         noarch                                    1.5.1-1.el9                                          beaker-AppStream                                     35 k
 lvm2-dbusd                                        noarch                                    9:2.03.21-2.el9                                      beaker-AppStream                                    133 k
 sanlock                                           x86_64                                    3.8.4-4.el9                                          beaker-AppStream                                    162 k
Installing dependencies:
 boom-boot-conf                                    noarch                                    1.5.1-1.el9                                          beaker-AppStream                                     26 k
 python3-boom                                      noarch                                    1.5.1-1.el9                                          beaker-AppStream                                    585 k
 python3-pyudev                                    noarch                                    0.22.0-6.el9                                         beaker-BaseOS                                        94 k

Transaction Summary
============================================================================================================================================================================================================
Install  6 Packages

Total download size: 1.0 M
Installed size: 4.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): boom-boot-conf-1.5.1-1.el9.noarch.rpm                                                                                                                                393 kB/s |  26 kB     00:00    
(2/6): boom-boot-1.5.1-1.el9.noarch.rpm                                                                                                                                     487 kB/s |  35 kB     00:00    
(3/6): lvm2-dbusd-2.03.21-2.el9.noarch.rpm                                                                                                                                  1.9 MB/s | 133 kB     00:00    
(4/6): python3-pyudev-0.22.0-6.el9.noarch.rpm                                                                                                                               5.0 MB/s |  94 kB     00:00    
(5/6): sanlock-3.8.4-4.el9.x86_64.rpm                                                                                                                                       5.0 MB/s | 162 kB     00:00    
(6/6): python3-boom-1.5.1-1.el9.noarch.rpm                                                                                                                                   13 MB/s | 585 kB     00:00    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                       8.6 MB/s | 1.0 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                    1/1 
  Installing       : boom-boot-conf-1.5.1-1.el9.noarch                                                                                                                                                  1/6 
  Installing       : python3-boom-1.5.1-1.el9.noarch                                                                                                                                                    2/6 
  Installing       : python3-pyudev-0.22.0-6.el9.noarch                                                                                                                                                 3/6 
  Installing       : lvm2-dbusd-9:2.03.21-2.el9.noarch                                                                                                                                                  4/6 
  Running scriptlet: lvm2-dbusd-9:2.03.21-2.el9.noarch                                                                                                                                                  4/6 
  Installing       : boom-boot-1.5.1-1.el9.noarch                                                                                                                                                       5/6 
  Running scriptlet: sanlock-3.8.4-4.el9.x86_64                                                                                                                                                         6/6 
  Installing       : sanlock-3.8.4-4.el9.x86_64                                                                                                                                                         6/6 
  Running scriptlet: sanlock-3.8.4-4.el9.x86_64                                                                                                                                                         6/6 
  Verifying        : boom-boot-1.5.1-1.el9.noarch                                                                                                                                                       1/6 
  Verifying        : boom-boot-conf-1.5.1-1.el9.noarch                                                                                                                                                  2/6 
  Verifying        : lvm2-dbusd-9:2.03.21-2.el9.noarch                                                                                                                                                  3/6 
  Verifying        : python3-boom-1.5.1-1.el9.noarch                                                                                                                                                    4/6 
  Verifying        : sanlock-3.8.4-4.el9.x86_64                                                                                                                                                         5/6 
  Verifying        : python3-pyudev-0.22.0-6.el9.noarch                                                                                                                                                 6/6 
Installed products updated.

Installed:
  boom-boot-1.5.1-1.el9.noarch   boom-boot-conf-1.5.1-1.el9.noarch   lvm2-dbusd-9:2.03.21-2.el9.noarch   python3-boom-1.5.1-1.el9.noarch   python3-pyudev-0.22.0-6.el9.noarch   sanlock-3.8.4-4.el9.x86_64  

Complete!

[root@virt-552 ~]# boom list
BootID  Version                  Name                     RootDevice

[root@virt-552 ~]# lvs -a -o +devices
  LV   VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices       
  root rhel_virt-552 -wi-ao----  <6.20g                                                     /dev/vda2(205)
  swap rhel_virt-552 -wi-ao---- 820.00m                                                     /dev/vda2(0)  
[root@virt-552 ~]# pvscan
  PV /dev/vda2   VG rhel_virt-552   lvm2 [<7.00 GiB / 0    free]
  Total: 1 [<7.00 GiB] / in use: 1 [<7.00 GiB] / in no VG: 0 [0   ]

[root@virt-552 ~]# df
Filesystem                      1K-blocks    Used Available Use% Mounted on
devtmpfs                             4096       0      4096   0% /dev
tmpfs                             2024464       0   2024464   0% /dev/shm
tmpfs                              809788    8724    801064   2% /run
/dev/mapper/rhel_virt--552-root   6430720 4152240   2278480  65% /
/dev/vda1                          983040  238056    744984  25% /boot
tmpfs                              404820       4    404816   1% /run/user/0

[root@virt-552 ~]# ls -l /boot/loader/entries
total 8
-rw-r--r--. 1 root root 532 Jul 13 21:21 183272bc2d1c42f385a37259deaa35c8-0-rescue.conf
-rw-r--r--. 1 root root 452 Jul 13 21:21 183272bc2d1c42f385a37259deaa35c8-5.14.0-337.el9.x86_64.conf


Version-Release number of selected component (if applicable):
boom-boot-1.5.1-1.el9    BUILT: Wed May 17 03:00:49 PM CEST 2023

Comment 1 Bryn M. Reeves 2023-07-17 15:42:32 UTC
This is because on the virt host there is no profile set up. By default boom will not list boot entries for which it cannot find a valid profile (since we can't manipulate them usefully without an OsProfile). These entries can be optionally displayed by using --all:

[root@localhost ~]# boom list
BootID  Version                  Name                     RootDevice
[root@localhost ~]# boom list --all
BootID  Version                                   Name                     RootDevice           
40da505 5.14.0-337.el9.x86_64                                              /dev/mapper/rhel-root
887dc88 0-rescue-a693ef7fe2c44a559151b64919509e17                          /dev/mapper/rhel-root

If you create a profile that matches the OS version then the "normal" system boot entry will start showing up:

[root@localhost ~]# boom profile create --from-host
Created profile with os_id 6514b55:
  OS ID: "6514b555d12abeb890c92453c3127d7bf1f52329",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "9.3 (Plow)", Version ID: "9.3",
  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} crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/swap rhgb quiet",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_arg grub_class id", UTS release pattern: "el9"
[root@localhost ~]# boom list
BootID  Version                  Name                     RootDevice           
40da505 5.14.0-337.el9.x86_64    Red Hat Enterprise Linux /dev/mapper/rhel-root

The rescue boot entry will only show up with --all because the version strings used in that boot entry do not conform to the normal expected uname pattern.

The physical host where the system boot entry is showing up seems to have already had an OsProfile created as there is a boom-managed boot entry in /boot/loader/entries:

-rw-r--r--. 1 root root 537 Jul 13 21:07 7b2d82dad70f4ece8f867b6a482308de-cd14f03-5.14.0-322.el9.x86_64.conf