Bug 2050449

Summary: In Rhel 9 lvm.conf filters are not used by default and devices holding exported VGs do not show in pvs by default!
Product: Red Hat Enterprise Linux 9 Reporter: Lance Digby <ldigby>
Component: lvm2Assignee: Lance Digby <ldigby>
lvm2 sub component: Devices, Filtering and Stacking QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: high    
Priority: unspecified CC: agk, bubrown, heinzm, jbrassow, jmagrini, jpittman, mgandhi, msnitzer, prajnoha, rmadhuso, teigland, zkabelac
Version: 9.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-02 04:47:01 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:

Comment 5 David Teigland 2022-02-04 17:02:54 UTC
Hi, there are some good points you raise here.  Upgrading an existing RHEL8 system shouldn't generally have this problem because the RHEL8 system will not have a system.devices file, which disables the devices file functionality.  Installing a new RHEL9 system with LVM PVs attached should also not have this problem because the installer will run vgimportdevices -a to include existing PVs in the new system.  The tricky case, which you've described, is attaching old PVs to a newly installed RHEL9 system (which is using the devices file by default.)  In that scenario, we don't want lvm to automatically assume that attached PVs should be used, because often times it's not a correct or safe assumption (e.g. the devices hold guest vm images, in which case the host using them concurrently with the guest may corrupt them.)  I'm interested in knowing if or how we could notify users about newly attached PVs that are being ignored by lvm.  But, I've struggled to come up with a reasonable way to do that (making it visible and timely, while also not looking outside the devices file to a degree that defeats its purpose.)  Although it will be a more common issue in RHEL9, it isn't a completely new issue, because in the past a whitelist-style filter would also silently ignore new PVs.

Comment 6 Lance Digby 2022-02-07 03:08:10 UTC
Thanks for the clarification this makes sense. 

The only suggestion would be to make clear the following errors, they do not help unless you already know about the system.devices file.  
*****   
[root@rhel9 ~]# pvscan --cache /dev/mapper/ldpath04
  pvscan[3291] /dev/mapper/ldpath04 excluded by devices file (checking PVID).
..
[root@rhel9 ~]# journalctl -b | grep dm-3 
Feb 07 13:41:01 rhel9.lddomain lvm[1124]: /dev/dm-3 excluded by devices file (checking PVID).
*****
     
The section  
   excluded by devices file (checking PVID).
could be change to 
   excluded by /etc/lvm/devices/system.devices 

And in /etc/lvm/devices/system.devices
after 
    # LVM uses devices listed in this file.
add something like 
   # to maintain this file use the lvmdevices or vgimportdevices commands. 

 I realize there can be more device files than /etc/lvm/devices/system.devices but if a CU has these they should understand the process.

Comment 9 Lance Digby 2022-03-02 04:46:26 UTC
Have created solution https://access.redhat.com/solutions/6717161 to address this. 
If new disks are added and are to be used by lvm "pvscan --cache" should be run anyway and this reports the "excluded by devices file (checking PVID)." for the new disks so I think this is covered! closing the bug.