+++ This bug was initially created as a clone of Bug #2109351 +++
Description of problem:
Disabling multipath component detection in lvm.conf does not have any effect. It always ignores PVs on native devices irrespective of whether multipath component detection is enabled or not.
We have a specific requirement for lvm to NOT ignore PVs on multiple native devices when dm-multipath is NOT enabled.
This is needed to support Dell EMC PowerPath multipathing software with RHEL9 on BFS (Boot from SAN) hosts. When a BFS host is booted up, the root LV needs to be seen from one of the native devices to the boot lun. Then after the kernel loads, PowerPath will start and do multipathing.
Because of the multipath_component_detection issue, lvm does not see the PVs on the native devices on bot (as it ignores them) and hence the host does not boot up when there are multiple paths to the boot lun.
Version-Release number of selected component (if applicable):
lvm2-libs-2.03.14-4.el9.x86_64
lvm2-2.03.14-4.el9.x86_64
How reproducible:
Every time.
Steps to Reproduce:
1. Disable both the use of devices file and multipath component detection in /etc/lvm/lvm.conf by setting the following.
use_devicesfile = 0
multipath_component_detection = 0
2. Create a PV on one path of a native device to an array LUN.
[root@ncpp227046 ~]# pvcreate /dev/sdci
Physical volume "/dev/sdci" successfully created.
3. Run pvscan to see the just created PV.
[root@ncpp227046 ~]# pvscan
PV /dev/sdh3 VG rhel_ncpp227046 lvm2 [53.41 GiB / 0 free]
Total: 1 [53.41 GiB] / in use: 1 [53.41 GiB] / in no VG: 0 [0 ]
The PV shown above is a different PV on the local hard disk. It does not show the PV on the just created device.
Actual results:
pvscan does not show the PV on a native device. Here, /dev/sdci, /dev/sddc and /dev/sdbk are all paths to the same array LUN.
As seen below from the snippet of 'pvscan -vvv' output, lvm ignores all the native devices as it sees duplicate PVIDs on them. It does this because it believes there will be a dm-multipath device also available - but in our case there will not be any dm-multipath device as dm-multipath is not enabled (and cannot be enabled also).
Resolving duplicate devices
Checking for multipath components for duplicate PVID fNvc7okgiFdvF1ociAUMMGwhic5rfHxL
Same wwids for duplicate PVs /dev/sdci /dev/sddc
Same wwids for duplicate PVs /dev/sdci /dev/sdbk
Ignoring multipath component /dev/sdci with PVID fNvc7okgiFdvF1ociAUMMGwhic5rfHxL (dropping info)
Ignoring multipath component /dev/sddc with PVID fNvc7okgiFdvF1ociAUMMGwhic5rfHxL (dropping duplicate)
Ignoring multipath component /dev/sdbk with PVID fNvc7okgiFdvF1ociAUMMGwhic5rfHxL (dropping duplicate)
Expected results:
pvscan should have shown /dev/sdci and duplicate PVs on /dev/sddc and /dev/sdbk. Essentially we require a similar behavior as in older LVM versions (such as in RHEL 8).
Additional info:
We cannot use devices file also in our scenario as there is a need to support SRDF (remote replication) scenarios where the wwids of the devices can be different depending on whether the paths are coming from the local or remote array.
--- Additional comment from David Teigland on 2022-07-25 16:24:42 UTC ---
I will look into applying the multipath_component_detection setting to the newly expanded detection features also.
--- Additional comment from Gopinath Marappan on 2022-07-25 16:30:42 UTC ---
Thanks David!
Btw, I have a patch that fixes this issue. But I couldn't raise a pull request at https://github.com/lvmteam/lvm2 as I dont have access.
If you can add me as a contributor, I can do a pull request.
I have also filed an issue for this in the github repo - https://github.com/lvmteam/lvm2/issues/86 .
Please advise. Thanks.
--- Additional comment from David Teigland on 2022-07-25 19:26:04 UTC ---
fix in main branch:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=99ce09ae778c2cc4aa2611e425bba5287b8b9513
# rm /run/lvm/hints
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 rhel_null-04 lvm2 a-- <464.76g 0
# rm /run/lvm/hints
# pvs --config devices/multipath_component_detection=0
WARNING: Not using device /dev/sdj for PV CqOFo8-ozdc-4yiu-SFjd-jcH2-qFqs-V2KneR.
WARNING: PV CqOFo8-ozdc-4yiu-SFjd-jcH2-qFqs-V2KneR prefers device /dev/sdi because device was seen first.
PV VG Fmt Attr PSize PFree
/dev/sda2 rhel_null-04 lvm2 a-- <464.76g 0
/dev/sdi lvm2 --- 100.00m 100.00m
--- Additional comment from David Teigland on 2022-07-25 19:29:31 UTC ---
(In reply to Gopinath Marappan from comment #2)
> Thanks David!
>
> Btw, I have a patch that fixes this issue. But I couldn't raise a pull
> request at https://github.com/lvmteam/lvm2 as I dont have access.
>
> If you can add me as a contributor, I can do a pull request.
Sorry, I'm afraid we largely ignore the github repo and primarily use sourceware.
> I have also filed an issue for this in the github repo -
> https://github.com/lvmteam/lvm2/issues/86 .
OK, we also need a bz for the issue in order to get it released in RHEL.
--- Additional comment from Gopinath Marappan on 2022-07-26 03:25:48 UTC ---
Thanks for the quick fix David.
Will it be possible to backport the fix to RHEL9.0 and RHEL9.1?