Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2128026

Summary: allow varying wwid types for device id
Product: Red Hat Enterprise Linux 9 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Devices, Filtering and Stacking QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 9.1Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.17-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:23:45 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 David Teigland 2022-09-19 16:06:52 UTC
Description of problem:

There are multiple types of WWID: NAA, EUI, T10.  A single device may have multiple wwids including one or more of each type.  lvm partially uses these different wwid types:
- The sysfs wwid file prints one of them, and lvm only uses that one for the device id (in the devices file.)
- The sysfs vpd_pg83 file includes all of them, and lvm uses all of them when checking the /etc/multipath/wwids file for a device.

So, multiple wwids are currently used for matching the multipath config, but are not used for device ids.  We should allow device ids to also take advantage of different wwid types:

. if there is no sysfs wwid file, lvm should try to find and use a wwid from the vpd_pg83 file.  (I have not seen this happen before, so this is a theoretical improvement.)

. if the kernel changes which wwid type it prints from sys/wwid, lvm should use the other wwids from sys/vpd_pg83 to match the device in the devices file.  e.g. if a kernel update or device update causes sys/wwid to print an naa wwid when it previously printed a t10 id, then that device would not be found unless the vpd_pg83 wwids are also checked.  (This has happened before due to a kernel change.)

. allow the user to specify a different wwid type for the device from what the kernel has chosen to print from the sys/wwid.  e.g. if sysfs wwid prints a t10 wwid, the user should be able to select a naa wwid to use as the device id instead.  A certain device may have a poorly defined t10 wwid (e.g. generated from a software config), but a good naa wwid (e.g. from the hardware.)  If the kernel decided to print an inferior t10 wwid, then the user may want to explicitly tell lvm to use the naa wwid.

. add explicit device id types for the different wwid types: wwid_naa, wwid_eui, wwid_t10, and use these types when the wwid is taken from sys/vpd_pg83.  To allow the user to specify a certain wwid type, we need device id types for each of them.  lvm will continue to use the existing "sys_wwid" by default, and whatever value comes from sys/wwid.  If the user selects one of the new wwid types, then the devices file entry would not be recognized by old lvm versions, and the old lvm would not be able to use the device.  At the command level, this would look like "lvmdevices --deviceidtype wwid_naa --adddev <dev>", and in the devices file it would look like IDTYPE="wwid_naa" IDNAME="naa.....".

Testing this is a challenge because it's based on sysfs files exposed from the kernel, and there's no way to create custom sysfs files to test against.  Also, the vpd_pg83 file is a binary blob of data, and we don't have a way to create custom blobs containing different wwid combinations.  The way I am testing this at the source level, is
. changing lvm to look for sysfs in "/test/sys"
. manually creating a fake sysfs hierarchy under /test/sys for my devices
. copying binary blobs that I've collected from real devices into the fake vpd_pg83 files.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Corey Marthaler 2022-12-01 18:55:28 UTC
Marking Verifed:Tested (SanityOnly) now that devicesfile regression testing has finished on the latest 9.2 rpms.

kernel-5.14.0-176.el9    BUILT: Wed Oct 12 03:57:18 AM CDT 2022
lvm2-2.03.17-1.el9    BUILT: Thu Nov 10 10:02:16 AM CST 2022
lvm2-libs-2.03.17-1.el9    BUILT: Thu Nov 10 10:02:16 AM CST 2022

Comment 8 Corey Marthaler 2022-12-19 19:45:49 UTC
Verified in the latest rpms as well.

kernel-5.14.0-205.el9    BUILT: Fri Dec  2 07:14:37 AM CST 2022
lvm2-2.03.17-3.el9    BUILT: Wed Dec  7 10:41:40 AM CST 2022
lvm2-libs-2.03.17-3.el9    BUILT: Wed Dec  7 10:41:40 AM CST 2022

Comment 10 errata-xmlrpc 2023-05-09 08:23:45 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 (lvm2 bug fix and enhancement update), 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/RHBA-2023:2544