Bug 1561258

Summary: grub2-mkconfig on node produce incorrect grub2.cfg if a local VG is present
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: ovirt-node-ngAssignee: Ryan Barry <rbarry>
Status: CLOSED ERRATA QA Contact: jiachen zhang <jiaczhan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.10CC: alex-redhat, bgraveno, cshao, dfediuck, huzhao, mgoldboi, qiyuan, rbarry, sbonazzo, yaniwang, ycui, yzhao
Target Milestone: ovirt-4.2.3Flags: lsvaty: testing_plan_complete-
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: imgbased-1.0.12 Doc Type: Bug Fix
Doc Text:
To properly set boot flags if grub2-mkconfig is run, or a new kernel is installed, Red Hat Virtualization Host (RHVH) ships with a custom grub generator. This generator uses a list of all local LVM volume groups to create boot arguments, but systems with local storage domains on separate volume groups are currently present in the list, which could result in incorrect flags being in the grub.conf file. This update enables RHVH grub generators to explicitly look for the RHVH volume group, and ignore others.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-15 17:57:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Germano Veit Michel 2018-03-28 00:36:04 UTC
Description of problem:

While attempting to run grub2-mkconfig on RHVH, the produced configuration file is incorrect if the host contains another local VG other than rhvh.

Version-Release number of selected component (if applicable):
RHVH-4.1-20180315.0-RHVH-x86_64-dvd1.iso

How reproducible:
100%

Steps to Reproduce:
1. Have vm local storage on the host. For example:

# vgs
  VG        #PV #LV #SN Attr   VSize    VFree  
  rhvh        1  10   0 wz--n-  <74.00g <13.84g
  vg_vmpool   1   1   0 wz--n- 1020.00m 508.00m

# grep vmpool /etc/fstab 
/dev/mapper/vg_vmpool-lv_vmpool /data xfs defaults 0 0

2. Install a hotfix kernel
rpm -Uvh kernel-1.2.3
cp /boot/*1.2.3* /boot/$(imgbase layer --current)
grub2-mkconfig -o /etc/grub2.cfg (or /etc/grub2-efi.cfg if EFI)

Actual results:
grub2.cfg contains incorrect info. It appended both vg names:
root=/dev/rhvhvg_vmpool/rhvh-4.1-0.20180314.0+1
rd.lvm.lv=rhvhvg_vmpool/rhvh-4.1-0.20180314.0+1

Expected results:
root=/dev/rhvh/rhvh-4.1-0.20180314.0+1
rd.lvm.lv=rhvh/rhvh-4.1-0.20180314.0+1

Comment 2 Ryan Barry 2018-03-28 01:58:11 UTC
This is definitely not related to a new kernel

Comment 3 jiachen zhang 2018-04-04 02:46:43 UTC
I can reproduce this bug successfully, and the key step as follow:
To creat a vg in kickstart:

### Partitioning ###
#ignoredisk --drives=sda
zerombr
clearpart --all
bootloader --location=mbr
reqpart --add-boot
part pv.01 --ondisk=/dev/sda --size=300000
part pv.02 --ondisk=/dev/sda --size=100000
volgroup rhvh pv.01 --reserved-percent=2
volgroup test pv.02
logvol swap --fstype=swap --name=swap --vgname=rhvh --recommended
logvol none --name=pool --vgname=rhvh --thinpool --size=200000 --grow
logvol / --fstype=ext4 --name=root --vgname=rhvh --thin --poolname=pool --size=100000 --grow
logvol /var --fstype=ext4 --name=var --vgname=rhvh --thin --poolname=pool --size=20000
logvol /data --fstype=xfs --name=data --vgname=test --size=50000

then we will have two vg.

Then find the suitable kernal to update it.

Comment 5 jiachen zhang 2018-05-09 09:01:40 UTC
Test this bug with the version redhat-virtualization-host-4.2-20180507.0
Original Kernel: kernel-3.10.0-862-2.3
After run the command "rpm -Uvh", upgraded the kernel to kernel-3.10.0-862
Follow the steps I got the correct results.
So the bug has been fixed successfully.

Comment 8 errata-xmlrpc 2018-05-15 17:57:47 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/RHSA-2018:1524

Comment 9 Ryan Barry 2018-05-29 13:42:27 UTC
*** Bug 1583675 has been marked as a duplicate of this bug. ***

Comment 10 Franta Kust 2019-05-16 13:05:54 UTC
BZ<2>Jira Resync

Comment 11 Daniel Gur 2019-08-28 13:13:09 UTC
sync2jira

Comment 12 Daniel Gur 2019-08-28 13:17:22 UTC
sync2jira