Bug 1542952

Summary: Boom should check and warn if grub2 integration is not enabled
Product: Red Hat Enterprise Linux 7 Reporter: Bryn M. Reeves <bmr>
Component: lvm2Assignee: Bryn M. Reeves <bmr>
lvm2 sub component: Other QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, prockai, rhandlin, zkabelac
Version: 7.5   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.177-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:23:49 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 Bryn M. Reeves 2018-02-07 12:45:22 UTC
Description of problem:
Boom adds a script to /etc/grub.d which will insert the necessary snippet to load BLS entries.

If the boom package is installed but the user has not run grub2-mkconfig since (or e.g. updated the kernel package which will do this automatically) then the grub configuration is never generated and boom entries will not appear in the grub menu.

Rather than risking modifying /boot/grub2/grub.cfg via a %post hook, the tool should check for the presence of the snippet (if enabled), and warn the user with a message indicating the command needed to regenerate the configuration.

Version-Release number of selected component (if applicable):
All versions of lvm2-python-boom

How reproducible:
100%

Steps to Reproduce:
1. yum -y install lvm2-python-boom
2. boom create --title Title --rootlv some/lv
3. reboot

Actual results:
No boom entries in grub2 menu.

Expected results:
New "Title" boom entry in grub2 menu.

Additional info:

Comment 1 Bryn M. Reeves 2018-02-07 15:42:45 UTC
In boom-0.8.3.

Comment 3 Corey Marthaler 2018-02-07 22:38:30 UTC
Fix verified in the latest rpms.

3.10.0-847.el7.x86_64

lvm2-2.02.177-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
lvm2-libs-2.02.177-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
lvm2-cluster-2.02.177-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
lvm2-lockd-2.02.177-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
lvm2-python-boom-0.8.3-2.el7    BUILT: Wed Feb  7 17:42:09 CET 2018
cmirror-2.02.177-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
device-mapper-1.02.146-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
device-mapper-libs-1.02.146-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
device-mapper-event-1.02.146-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
device-mapper-event-libs-1.02.146-2.el7    BUILT: Wed Feb  7 17:39:26 CET 2018
device-mapper-persistent-data-0.7.3-3.el7    BUILT: Tue Nov 14 12:07:18 CET 2017


[root@host-082 ~]#  boom create --title "root snap1"  --rootlv test/snap1
WARNING - Boom configuration not found in grub.cfg
WARNING - Run 'grub2-mkconfig > /boot/grub2/grub.cfg' to enable
Created entry with boot_id 3061e1e:
  title root snap1
  machine-id 4be78ac81dac49098952215ac6624209
  version 3.10.0-847.el7.x86_64
  linux /vmlinuz-3.10.0-847.el7.x86_64
  initrd /initramfs-3.10.0-847.el7.x86_64.img
  options root=/dev/test/snap1 ro rd.lvm.lv=test/snap1 rhgb quiet

[root@host-082 ~]# grub2-mkconfig > /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-847.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-847.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-4be78ac81dac49098952215ac6624209
Found initrd image: /boot/initramfs-0-rescue-4be78ac81dac49098952215ac6624209.img
done

[root@host-082 ~]#  boom create --title "root snap2"  --rootlv test/snap2
Created entry with boot_id 35eeecd:
  title root snap2
  machine-id 4be78ac81dac49098952215ac6624209
  version 3.10.0-847.el7.x86_64
  linux /vmlinuz-3.10.0-847.el7.x86_64
  initrd /initramfs-3.10.0-847.el7.x86_64.img
  options root=/dev/test/snap2 ro rd.lvm.lv=test/snap2 rhgb quiet

[root@host-082 ~]# boom list
BootID  Version                  Name                            RootDevice     
3061e1e 3.10.0-847.el7.x86_64    Red Hat Enterprise Linux Server /dev/test/snap1
35eeecd 3.10.0-847.el7.x86_64    Red Hat Enterprise Linux Server /dev/test/snap2


# Boot Menu:

 Red Hat Enterprise Linux Server (3.10.0-847.el7.x86_64) 7.4 (Maipo)       
 Red Hat Enterprise Linux Server (0-rescue-4be78ac81dac49098952215ac66242>
 Snapshots 
     root snap1                                                                
     root snap2

Comment 6 errata-xmlrpc 2018-04-10 15:23:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0853