This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2217510 - RFE: default to creating lvmdevices file on RPM install
Summary: RFE: default to creating lvmdevices file on RPM install
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: lvm2
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-26 13:32 UTC by Dusty Mabe
Modified: 2023-09-23 19:20 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-23 19:20:09 UTC
Type: Story
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-8351 0 None Migrated None 2023-09-23 19:19:26 UTC
Red Hat Issue Tracker RHELPLAN-160787 0 None None None 2023-06-26 13:48:51 UTC

Description Dusty Mabe 2023-06-26 13:32:01 UTC
Description of problem:

In RHEL 9 an LVM devices file gets created by Anaconda if the install includes an LVM storage configuration [1]. This is an RFE to make the creation of the devices file in `/etc/` always happen (at least for new installs) via RPM scriptlets instead.

[1] https://github.com/rhinstaller/anaconda/blob/6f604b55f6caa5d570764a1d236287fe7ad735ab/pyanaconda/modules/storage/installation.py#L334-L355

Background:

RHCOS (basis of OpenShift) doesn't use Anaconda to perform an installation. It does use a tool (`coreos-installer`), but the tool mostly just does a dd of a prebuilt image to the disk (basic partition+filesystems, no LVM). The pre-built image does include the LVM RPMs, though.

We are currently encountering an issue [2] where Kubevirt guests (virtual machines) where the users choose to put LVM on attached block devices is conflicting with the host (both guest and host are interacting with the LVM devices). Here are a few details:

- Running pods (containers) that start VirtualMachines.
- These VirtualMachines can have block storage attached to them.
- Users can choose to create LVM PVs out of this block storage.
- Both the Host (RHCOS Running OpenShift) and Guest see LVM signatures on these devices.
- Need a way to tell the host to completely ignore the devices attached to the guest.
- lvmdevices is relatively new, but presents an option
- RHCOS can implement a workaround/fix for this for now
    - but would like to not behave differently than RHEL in the long term


For RHCOS we are planning to implement a workaround for this where upgrading nodes have a script that gets run to create an LVM devices file (either empty or with any detected LVM devices from the host), but in the long run we'd like to not differ from RHEL here, which means have a solution to this problem in the RPMs I believe. 

[2] https://issues.redhat.com/browse/OCPBUGS-5223

Comment 2 David Teigland 2023-06-26 17:06:42 UTC
The basic idea of using system.devices on the host is the right idea; this is one of the specific cases that we created the devices file to address (in RHV at the time.)  The hard part is the installation/initialization issues, because everything in that area is so customized these days, it's not just anaconda these days.  It's likely that customized installation methods will also need custom ways to handle the devices file.

The basic logic, as you've already seen, is:
- No system.devices disables the feature, and causes the machine to fall back to using the lvm.conf filter.  
- Existing but empty system.devices enables the feature, and causes the machine to see no PVs.
- pvcreate will create a new system.devices file only if there are no other PVs seen on the machine.
- lvmdevices --adddev and vgimportdevices will always create a new system.devices file.

This logic allows us to enable the devices file feature by default in RHEL9, while also allowing upgrades from RHEL8 without any disruption for users.  Existing lvm.conf filters users had configured in RHEL8 will continue to work after upgrading to RHEL9.  A user who wants to enable the devices file after upgrading can just run vgimportdevices -a.

For anaconda, it was simpler for them to keep the devices file feature off during installation, which meant they could just keep all their existing lvm usage unchanged.  At the end they just added vgimportdevices -a to create a new system.devices from the PVs they'd created.

The suggestion to create a new, empty system.devices file from the rpm install sounds reasonable, but I worry about it breaking other cases.  What if a user uninstalls and reinstalls the lvm rpm?  Wouldn't that break machines that are depending on no system.devices to disable the feature?  I have very little knowledge about the creative ways that rpms are used, and what expectations exist.  Maybe someone with more expertise can tell us what's safe to assume in an rpm install.

I'm doubtful that we could get by with an rpm script populating system.devices.  A command to do this scans disks on the system, which can be non-trivial, and I'm not sure it's safe to assume that all necessary disks are present at the time of the rpm install.

There are some other similar cases where we might like to recreate system.devices on first boot (bug 2213157, bug 2059545).  Even virt-sysprep, which is meant to solve this, will just remove system.devices and doesn't have a solution for recreating system.devices.  I've been thinking about some method were a temp file could be created in the image that would trigger lvm to recreate system.devices before using it. Maybe some of these ideas could be useful.

Comment 3 David Teigland 2023-07-21 18:45:04 UTC
I've created bug 2224641 describing a method for lvm to automatically generate a system.devices file for the root VG, and it may be a solution for this case.

Comment 5 RHEL Program Management 2023-09-23 19:15:10 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 6 RHEL Program Management 2023-09-23 19:20:09 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


Note You need to log in before you can comment on or make changes to this bug.