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 2076262 - lvm ignores multipath blacklist configuration
Summary: lvm ignores multipath blacklist configuration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.6
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 2087534 2094535 (view as bug list)
Depends On:
Blocks: 2074765 2100133 2107162
TreeView+ depends on / blocked
 
Reported: 2022-04-18 13:33 UTC by Gobinda Das
Modified: 2023-05-16 04:22 UTC (History)
27 users (show)

Fixed In Version: lvm2-2.03.14-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2100133 2107162 (view as bug list)
Environment:
Last Closed: 2022-11-08 10:55:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-5780 0 None None None 2022-07-27 16:01:46 UTC
Red Hat Issue Tracker RHELPLAN-119166 0 None None None 2022-04-19 06:25:48 UTC
Red Hat Knowledge Base (Solution) 6962651 0 None None None 2022-06-09 14:46:54 UTC
Red Hat Product Errata RHBA-2022:7792 0 None None None 2022-11-08 10:55:52 UTC

Comment 1 Nir Soffer 2022-04-18 14:37:26 UTC
(In reply to Gobinda Das from comment #0)
> Always VG creation fails with below error:
> [root@tendrl25 ~]# vgcreate gluster_vg_sdb /dev/sdb 
>   Cannot use /dev/sdb: device is a multipath component
>   Command requires all devices to be found.
> 
> Eventhough  sdb has no multipath enabled

Looks like a bug in lvm.

David, is this a known issue?

Comment 2 David Teigland 2022-04-18 14:53:23 UTC
I'm guessing might be caused by recent lvm improvements to identify multipath components.  lvm now also checks if a device's wwid is listed in /etc/multipath/wwids to see if it's a multipath component.  Could you check that for sdb, and if so, is there be a valid reason for the sdb wwid to be in wwids?  You can disable lvm's use of /etc/multipath/wwids by setting lvm.conf multipath_wwids_file="".  (I don't see an lvm version above so I'm not sure if you actually have this feature or not.)

Comment 3 Nir Soffer 2022-04-18 15:56:52 UTC
I looked at the host.

# rpm -q lvm2
lvm2-2.03.14-3.el8.x86_64

/dev/sdb is a multipath device - mentioned in /etc/multipath/wwids.
I guess it was added when multipath detected the devices, before it
was blacklisted.

The multipath device is blacklisted:

# cat /etc/multipath/conf.d/blacklist.conf 
# BEGIN ANSIBLE MANAGED BLOCK
blacklist {
# BEGIN ANSIBLE MANAGED BLOCK sdb
wwid "3600508b1001c08ea930b4ffe4a7e0c33"
# END ANSIBLE MANAGED BLOCK sdb
}
# END ANSIBLE MANAGED BLOCK

So multipath ignores this device, and so should lvm.

The device was also added to system.devices file - probably when
the pv was created:

# cat /etc/lvm/devices/system.devices 
# LVM uses devices listed in this file.
# Created by LVM command vgcreate pid 309575 at Mon Apr 18 12:57:43 2022
VERSION=1.1.2
IDTYPE=sys_wwid IDNAME=naa.600508b1001c9bf88ce1781e2c53a362 DEVNAME=/dev/sda2 PVID=KkyROuDmAzXHu1CCiZ0OpKCjLxJtb6z9 PART=2
IDTYPE=sys_wwid IDNAME=naa.600508b1001c08ea930b4ffe4a7e0c33 DEVNAME=/dev/sdb PVID=DrUc4fKfgqbT3oI79DIAi5Pif6It7xnE

So I think we need to update lvm to consider also multiapth blacklists.

Until this is available in lvm, removing the device entry from /etc/multipath/wwids
before create the pv should fix this issue.

On the host, I did:

1. Remove the device entry from /etc/lvm/devices/system.devices
2. Remove the device entry from /etc/multiapth/wwids
3. Add the device back to devices file:

    lvmdevices --adddev /dev/sdb

This added:

    # cat /etc/lvm/devices/system.devices | grep /dev/sdb
    IDTYPE=sys_wwid IDNAME=naa.600508b1001c08ea930b4ffe4a7e0c33 DEVNAME=/dev/sdb PVID=DrUc4fKfgqbT3oI79DIAi5Pif6It7xnE

And with this the pv is visible to the host, and creating a vg works:

    # pvs /dev/sdb
      PV         VG             Fmt  Attr PSize    PFree   
      /dev/sdb   gluster_vg_sdb lvm2 a--  <372.58g <372.58g

So I think the gluster setup should do:

1. Get a device WWID (e.g. udevadm info /dev/sdX | grep ID_SERIAL=)
2. Add multiapth blacklist for the device
3. Remove the device entry from /etc/wwids

At this point creating the PV should work normally.

Comment 4 Nir Soffer 2022-04-18 15:57:52 UTC
Ben - regarding comment 3:
- Is there a command to remove a device from /etc/multipath/wwids or
  the file should be modified directly?
- Do we need to reload multipathd after modifying /etc/multipath/wwids
or anything else?

Comment 5 David Teigland 2022-04-18 16:08:42 UTC
(In reply to Nir Soffer from comment #3)
> The multipath device is blacklisted:
> 
> # cat /etc/multipath/conf.d/blacklist.conf 
> # BEGIN ANSIBLE MANAGED BLOCK
> blacklist {
> # BEGIN ANSIBLE MANAGED BLOCK sdb
> wwid "3600508b1001c08ea930b4ffe4a7e0c33"
> # END ANSIBLE MANAGED BLOCK sdb
> }
> # END ANSIBLE MANAGED BLOCK

Yes, I need to update lvm to consider the blacklist.

Note that when using the devices file, there's little additional benefit from using /etc/multipath/wwids in lvm, so you could consider disabling that feature (setting multipath_wwids_file=""), and avoiding this issue in that way.

Comment 6 Ben Marzinski 2022-04-18 16:20:18 UTC
(In reply to Nir Soffer from comment #4)
> Ben - regarding comment 3:
> - Is there a command to remove a device from /etc/multipath/wwids or
>   the file should be modified directly?

/etc/multipath/wwids should not need to be directly modified.

# multipath -w <device_or_wwid>

will remove a wwid from the wwids file.

# multipath -W

Will update the wwids file so that it only contains the current multipath devices.

> - Do we need to reload multipathd after modifying /etc/multipath/wwids
> or anything else?

Nope. Whenever multipathd needs to check the wwids file for something, it will re-read it, so no reloading is necessary.

Comment 13 Nir Soffer 2022-06-06 15:55:50 UTC
David, an estimate on when this fix will be available?

Comment 14 David Teigland 2022-06-06 16:12:51 UTC
(In reply to Nir Soffer from comment #13)
> David, an estimate on when this fix will be available?

The next release which is 8.7.  Also the patch in comment 8 needs a small fix to handle wwid designator types 2/eui and 1/t10 (it only handles 3/naa).

Comment 15 David Teigland 2022-06-08 13:52:58 UTC
*** Bug 2094535 has been marked as a duplicate of this bug. ***

Comment 18 David Teigland 2022-06-10 16:43:44 UTC
To test:
pvcreate /dev/sdf
pvs should show the PV on sdf
multipath /dev/sdf
pvs should show the PV on the new mpath device
the wwid of sdf should be in /etc/multipath/wwids
add the wwid to the blacklist in multipath.conf
restart/reload multipath
pvs should show the PV on sdf
add the wwid to the blacklist exceptions in multipath.conf
restart/reload multipath
pvs should show the PV on the mpath device

This only supports wwid entries in the blacklist.
The lvm devices file needs to be disabled to test this.

Comment 20 Nir Soffer 2022-06-10 19:58:51 UTC
(In reply to David Teigland from comment #18)
> add the wwid to the blacklist in multipath.conf

This is only one possible location, the blacklist can also be in any 
file in 

    /etc/multipath/conf.d/*.conf

I think the configuration files should be sorted by file name, and read
in order. I don't remember documentation about how same section in multiple
files are handled, but when I tried it you can have multiple blacklist 
sections and all of them are merged together with the blacklist in
/etc/mutipath.conf. 

In RHV, changes are never done in /etc/multiapth.conf - this file is managed
by vdsm and it is replaced on upgrades, removing the user changes.

In both case, you can add the wwids as is:

    blacklist {
        wwid "xxxyyy"
    }

or a regex matching the wwid

    blacklist {
        wwid "^xxxyyy$"
    }

There is also blacklist_exceptions that overrides items in blacklist.
So the code should make sue the blacklisted devices are does not have
exceptions.

Comment 21 David Teigland 2022-06-10 21:08:34 UTC
(In reply to Nir Soffer from comment #20)
> (In reply to David Teigland from comment #18)
> > add the wwid to the blacklist in multipath.conf
> 
> This is only one possible location, the blacklist can also be in any 
> file in 
> 
>     /etc/multipath/conf.d/*.conf

yes, I'd forgotten that, lvm is reading blacklist and blacklist_exception sections in any of those files (all exceptions are processed last.)

> I think the configuration files should be sorted by file name, and read
> in order. I don't remember documentation about how same section in multiple
> files are handled, but when I tried it you can have multiple blacklist 
> sections and all of them are merged together with the blacklist in
> /etc/mutipath.conf. 

all the settings are merged, I'm not worrying about overriding rules at this point.

> In RHV, changes are never done in /etc/multiapth.conf - this file is managed
> by vdsm and it is replaced on upgrades, removing the user changes.
> 
> In both case, you can add the wwids as is:
> 
>     blacklist {
>         wwid "xxxyyy"
>     }
> 
> or a regex matching the wwid
> 
>     blacklist {
>         wwid "^xxxyyy$"
>     }

it's handling explicit wwids (with or without quotation), but not regex.  If people are in the habit of using ^$ around full wwids that would be simple enough to add immediately.  Otherwise, if people are really entering regexes with partial wwid strings, then we should create a new bug to add posix regex calls.

Comment 23 David Teigland 2022-06-22 14:08:20 UTC
These two commits should be included in the 8.6.z backport:

filter-mpath: use multipath blacklist
https://sourceware.org/git/?p=lvm2.git;a=commit;h=494372b4eed0c8f6040e3357939eb7511ac25745

filter-mpath: handle other wwid types in blacklist
https://sourceware.org/git/?p=lvm2.git;a=commit;h=c302903dbab1d5fd05b344c654bed83c9ecb69f8

Comment 27 Corey Marthaler 2022-07-19 14:27:54 UTC
The test case in comment #18 doesn't appear to have the expected behavior, either with or without the fix.


# hayes-02 (pre fix)

[root@hayes-02 ~]# pvcreate /dev/sdf
  Physical volume "/dev/sdf" successfully created.
[root@hayes-02 ~]# pvs /dev/sdf
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdf      lvm2 ---  <1.82t <1.82t

[root@hayes-02 ~]# multipath /dev/sdf
create: mpatha (36d094660650d1e0022bd2a001f1ae16e) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:5:0  sdf 8:80  undef ready running

[root@hayes-02 ~]#  pvs /dev/sdf
  Cannot use /dev/sdf: device is a multipath component

# pvs should show the PV on the new mpath device

[root@hayes-02 ~]# pvscan
  No matching physical volumes found


[root@hayes-02 ~]# cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/36d094660650d1e0022bd2a001f1ae16e/

[root@hayes-02 ~]# multipath -F
[root@hayes-02 ~]# multipath -v2
[root@hayes-02 ~]# multipath -l



[root@hayes-02 ~]# dmsetup ls
mpatha  (253:0)

[root@hayes-02 ~]# pvscan
  No matching physical volumes found

[root@hayes-02 ~]# cat /etc/lvm/devices/system.devices 
# LVM uses devices listed in this file.
# Created by LVM command pvremove pid 161051 at Tue Jul 19 08:07:24 2022
VERSION=1.1.44
IDTYPE=sys_wwid IDNAME=naa.6d094660650d1e0022bd2a001f1ae16e DEVNAME=/dev/sdf PVID=fuy8TmXGwy6XezuYxfoBgc2fTLi5jAZg

[root@hayes-02 ~]#  cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/36d094660650d1e0022bd2a001f1ae16e/

# add to /etc/multipath.conf
blacklist {
        wwid "36d094660650d1e0022bd2a001f1ae16e"
}

[root@hayes-02 ~]# pvscan
  No matching physical volumes found




# hayes-01 (post fix)

[root@hayes-01 ~]# pvcreate /dev/sdf
  Physical volume "/dev/sdf" successfully created.
[root@hayes-01 ~]# pvs /dev/sdf
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdf      lvm2 ---  <1.82t <1.82t
[root@hayes-01 ~]# multipath /dev/sdf
create: mpatha (36d094660575ece002291bb4a313e4759) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:5:0  sdf 8:80  undef ready running
[root@hayes-01 ~]# pvs /dev/sdf
  Cannot use /dev/sdf: device is a multipath component


# pvs should show the PV on the new mpath device

[root@hayes-01 ~]# pvscan
  No matching physical volumes found
[root@hayes-01 ~]# pvs /dev/mapper/mpatha
  Cannot use /dev/mapper/mpatha: device is not in devices file

[root@hayes-01 ~]# cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/36d094660575ece002291bb4a313e4759/

Comment 28 David Teigland 2022-07-25 15:30:24 UTC
the devices file needs to be disabled for the test

Comment 29 Corey Marthaler 2022-07-25 21:00:58 UTC
Marking Verified:Tested with the latest rpms.

kernel-4.18.0-409.el8    BUILT: Tue Jul 12 00:16:54 CDT 2022
lvm2-2.03.14-5.el8    BUILT: Thu Jul 14 09:23:13 CDT 2022
lvm2-libs-2.03.14-5.el8    BUILT: Thu Jul 14 09:23:13 CDT 2022



[root@hayes-01 ~]# grep use_devicesfile /etc/lvm/lvm.conf 
        # Configuration option devices/use_devicesfile.
        # use_devicesfile = 0
        use_devicesfile = 0     # edited by QA Thu Jul 21 16:20:09 2022

[root@hayes-01 ~]# pvscan
  No matching physical volumes found

[root@hayes-01 ~]# pvcreate /dev/sdg
  Physical volume "/dev/sdg" successfully created.
[root@hayes-01 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdg      lvm2 ---  <1.82t <1.82t

[root@hayes-01 ~]# multipath /dev/sdg
create: mpathb (36d094660575ece002291bd67517f677a) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:6:0  sdg 8:96  undef ready running

[root@hayes-01 ~]#  pvs
  PV                 VG Fmt  Attr PSize  PFree 
  /dev/mapper/mpathb    lvm2 ---  <1.82t <1.82t
[root@hayes-01 ~]# cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/36d094660575ece002291bd67517f677a/

/etc/multipath.conf
blacklist {
        wwid "36d094660575ece002291bd67517f677a"
}

[root@hayes-01 ~]#  multipath -F
[root@hayes-01 ~]#  multipath -v2
[root@hayes-01 ~]# multipath -l
[root@hayes-01 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdg      lvm2 ---  <1.82t <1.82t


/etc/multipath.conf
blacklist_exceptions {
        property "(SCSI_IDENT_|ID_WWN)"
        wwid "36d094660575ece002291bd67517f677a"
}
blacklist {
        wwid "36d094660575ece002291bd67517f677a"
}

[root@hayes-01 ~]# multipath -F
[root@hayes-01 ~]# multipath -v2
create: mpathb (36d094660575ece002291bd67517f677a) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:6:0  sdg 8:96  undef ready running
[root@hayes-01 ~]# multipath -l
mpathb (36d094660575ece002291bd67517f677a) dm-0 DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  `- 0:2:6:0  sdg 8:96  active undef running
[root@hayes-01 ~]# pvs
  PV                 VG Fmt  Attr PSize  PFree 
  /dev/mapper/mpathb    lvm2 ---  <1.82t <1.82t

Comment 32 Corey Marthaler 2022-08-09 19:13:38 UTC
Marking VERIFIED in the latest rpms.

kernel-4.18.0-414.el8    BUILT: Mon Aug  1 20:27:19 CDT 2022
lvm2-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022
lvm2-libs-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022


SCENARIO - lvm_usage_w_multipath_blacklist_and_devicesfile_disabled:  Test that lvm doesn't ignore multipath blacklist configuration with devicesfile disabled (bug 2076262)
adding entry to the devices file for /dev/sdf1
removing entry from the devices file for /dev/sdf1
Disabling devicesfile on hayes-01
Setting use_devicesfile to disable
Blanking out any potential partition header: dd if=/dev/zero of=/dev/sdf bs=1M count=500
500+0 records in
500+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 4.23713 s, 124 MB/s
adding entry to the devices file for /dev/sdf
** use_devicesfile is NOT currently enabled **
creating PV on hayes-01 using device /dev/sdf
pvcreate --yes -ff   /dev/sdf
  Physical volume "/dev/sdf" successfully created.
WARNING: This scenario will end up repartitioning your device for use w/ mpath!
multipath /dev/sdf
create: mpathb (36d094660575ece002291bb4a313e4759) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:5:0  sdf 8:80  undef ready running

Re-scanning lvm PVs (pvscan --cache)
  pvscan[69128] /dev/sdf excluded: device is a multipath component.
verify pvs multipath path /dev/mapper/mpathb
  PV                 VG Fmt  Attr PSize  PFree 
  /dev/mapper/mpathb    lvm2 ---  <1.82t <1.82t
verify pvs NON sd path /dev/sdf
  Cannot use /dev/sdf: device is a multipath component

grep 6d094660575ece002291bb4a313e4759 /etc/multipath/wwids
/36d094660575ece002291bb4a313e4759/
Added 6d094660575ece002291bb4a313e4759 to blacklist:
    wwid "6d094660575ece002291bb4a313e4759"
Copying out altered multipath.conf file to hayes-01
/tmp/multipath1721.conf -> hayes-01:/etc/multipath.conf
multipath -F
multipath -v2
multipath -l
verify pvs NON sd path /dev/sdf
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdf      lvm2 ---  <1.82t <1.82t

Added 6d094660575ece002291bb4a313e4759 to blacklist_exceptions:
    wwid "6d094660575ece002291bb4a313e4759"
Copying out altered multipath.conf file to hayes-01
/tmp/multipath373.conf -> hayes-01:/etc/multipath.conf
multipath -F
multipath -v2
create: mpathb (36d094660575ece002291bb4a313e4759) undef DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=undef
`-+- policy='service-time 0' prio=1 status=undef
  `- 0:2:5:0  sdf 8:80  undef ready running
multipath -l
mpathb (36d094660575ece002291bb4a313e4759) dm-0 DELL,PERC H330 Adp
size=1.8T features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  `- 0:2:5:0  sdf 8:80  active undef running
verify pvs multipath path /dev/mapper/mpathb
  PV                 VG Fmt  Attr PSize  PFree 
  /dev/mapper/mpathb    lvm2 ---  <1.82t <1.82t
verify pvs NON sd path /dev/sdf
  Cannot use /dev/sdf: device is a multipath component

multipath -f mpathb
multipath -W
successfully reset wwids
Using gpt label
Disk size: 1907199 MB
Num partitions: 1
Adding new primary partition: (40, 3905945559) = 1907199 MB
Committing changes
Removing wwid entry from /etc/multipath.conf:
    wwid "6d094660575ece002291bb4a313e4759" # edited by QA Tue Aug  9 14:11:59 2022
Removing wwid entry from /etc/multipath.conf:
    wwid "6d094660575ece002291bb4a313e4759" # edited by QA Tue Aug  9 14:11:52 2022
Copying out altered multipath.conf file to hayes-01
/tmp/multipath343.conf -> hayes-01:/etc/multipath.conf
Enabling devicesfile on hayes-01
Setting use_devicesfile to enable

Comment 34 errata-xmlrpc 2022-11-08 10:55:24 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-2022:7792

Comment 35 Isabel Lord 2023-01-18 04:36:23 UTC Comment hidden (spam)
Comment 36 Zdenek Kabelac 2023-02-14 12:12:52 UTC
*** Bug 2087534 has been marked as a duplicate of this bug. ***


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