Bug 1984851

Summary: Opt out from using LVM devices file in 9 Beta
Product: Red Hat Enterprise Linux 9 Reporter: Vojtech Trefny <vtrefny>
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jstodola, teigland
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-blivet-3.4.0-6.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-07 21:24:13 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:
Bug Depends On:    
Bug Blocks: 1749513    

Comment 1 Vojtech Trefny 2021-07-22 11:00:59 UTC
upstream PR: https://github.com/storaged-project/blivet/pull/968

Comment 5 Jan Stodola 2021-08-16 17:12:14 UTC
Pre-verified using python-blivet-3.4.0-6.el9 according to the steps from comment 2.
No file in /etc/lvm/devices/ was created during the installation or on the installed system.

Comment 12 David Teigland 2021-09-07 18:33:48 UTC
I don't understand if this has any effect on the default lvm configuration on a newly installed system, can someone clarify this?  After installation, the system.devices file must exist and contain the PVs created during installation.

Comment 13 Vojtech Trefny 2021-09-08 08:04:36 UTC
This only makes sure the devices file is not created during installation so we can keep using the "old" filtering. We don't add PVs to the system.devices and do not copy it to the installed system. My understanding was that without the file LVM will still default to not using it (i.e. scanning all devices) and the file won't be created even when adding new PVs/VGs (because pv/vgcreate refuses to create the file if other PVs/VGs already exist).

Populating the system.devices file and making sure it's copied to the installed system would require bigger changes to both blivet and anaconda, that's why we decided to implement only the minimal change to make sure the installation works without bigger changes. Work in progress "full" support for the devices file is available here: https://github.com/storaged-project/blivet/pull/972

Comment 14 David Teigland 2021-09-08 16:59:44 UTC
I believe that previous installations of RHEL9 had the devices file enabled, because I received bug reports from people who had not enabled it.  So the change to actively disable the devices file on an installed system must be somewhat recent.  Turning it off for RHEL9-beta and then on again in 9.0 GA would set us and users up for some very unpleasant surprises.  So, we need to find a way to keep this on.  If the installer cannot function with it enabled, then the installer could do its work with it off, and then enable and populate the devices file with the PVs it has created, as a final step.  There are a couple options that come to mind:

1. If the installer knows which PVs it has created for the new system, it can run lvmdevices --adddev <device> for each of them.  This will add each device to system.devices.

2. If the installer doesn't know which PVs it has created, then it could import every visible PV into system.devices using "vgimportdevices -a".  A possible downside of this command is if unwanted pre-existing VGs are visible (e.g. on other devices that happen to be attached), then those other VGs would also be made visible to the new system.  This would not be a huge problem, and if option 1 is more difficult then I'd not hesitate to use this option.

Comment 15 David Teigland 2021-09-08 17:02:53 UTC
Another option:

3. If the installer knows the specific VGs that it has created for the new system, it can run "vgimportdevices <vgname>" for each VG.

Comment 17 Jan Stodola 2021-09-23 08:17:55 UTC
lvm2-2.03.13-2.el9_b and python3-blivet-3.4.0-8.el9_b are present in RHEL-9.0.0-20210922.6 and no regressions were discovered. Moving this bug to VERIFIED based on previous testing.
The remaining part of dealing with lvm device file on the installed system will be fixed and tested in bug 2002550.