Bug 1593459

Summary: RFE: Make multipath able to blacklist by protocol/transport
Product: Red Hat Enterprise Linux 7 Reporter: Ben Marzinski <bmarzins>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED ERRATA QA Contact: Lin Li <lilin>
Severity: unspecified Docs Contact: Marek Suchánek <msuchane>
Priority: high    
Version: 7.6CC: agk, bmarzins, heinzm, lilin, msnitzer, nsoffer, prajnoha, rcyriac, rhandlin, salmy
Target Milestone: rcKeywords: FutureFeature, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: device-mapper-multipath-0.4.9-121.el7 Doc Type: Release Note
Doc Text:
DM Multipath now enables blacklisting or whitelisting paths by protocol Device Mapper Multipath (DM Multipath) now supports the "protocol" configuration option in the `blacklist` and `blacklist_exceptions` configuration sections. This enables you to blacklist or whitelist paths based on the protocol they use, such as `scsi` or `nvme`. For SCSI devices, you can also specify the transport: for example `scsi:fcp` or `scsi:iscsi`.
Story Points: ---
Clone Of:
: 1607749 (view as bug list) Environment:
Last Closed: 2018-10-30 11:27:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1016535, 1600672, 1607749    

Description Ben Marzinski 2018-06-20 22:00:43 UTC
Description of problem:
Right now, there is no way to easily tell multipath that you want to blacklist or whitelist devices based on what protocol and transport method that they are using. You can't easily (for instance) blacklist all devices except scsi devices using Fibre Channel or iSCSI. To solve this multipath needs a new blacklist/blacklist_exceptions type, "protocol". This will allow you to do things like

blacklist {
        protocol ".*"

blacklist_exceptions {
        protocol "(scsi:fcp|scsi:iscsi)"

Comment 2 Nir Soffer 2018-06-20 22:30:11 UTC
(In reply to Ben Marzinski from comment #0)
> blacklist_exceptions {
>         protocol "(scsi:fcp|scsi:iscsi)"
> }

Ben, can you explain why "scsi:fcp" or "scsi:iscsi" is needed, instead of "fcp"
os "iscsi"?

What is the advantage of the longer version?

Comment 3 Ben Marzinski 2018-06-20 23:12:33 UTC
You can also blacklist other protocols like "nvme" or "dasd". Right now, only "scsi" has multiple transport methods, but in the future multipath will likely need to distinguish between different "nvme" transports as well. This makes it easier to specify exactly what you want to blacklist.  It also maps onto how multipath internally distinguishes between device types.

Comment 4 Ben Marzinski 2018-06-20 23:23:32 UTC
The full list of protocol/transports that multipath recognizes and are available for blacklisting is:


Comment 5 Ben Marzinski 2018-06-20 23:29:19 UTC
oops. There's also "scsi:unspec" for scsi devices that don't have a detected transport (like scsi_debug) and "undef" for devices that don't have a detected protocol at all. Mostly, these are already caught by devnode or property blacklisting, but it is valid to run multipath on devices that don't have a detected procotol. Multipath just doesn't do any protocol specific actions on them.

Comment 6 Nir Soffer 2018-06-21 15:14:12 UTC
Thanks Ben, it makes sense. I hope that all this info will be in multipath.conf

Comment 7 Ben Marzinski 2018-06-22 18:00:45 UTC
Hopefully, this should work for you. Here's the information from the manpage:

blacklist section:

       protocol         Regular expression of the protocol to be excluded. See
                        below for a list of recognized protocols

       The  protocol strings that multipath recognizes are scsi:fcp, scsi:spi,
       scsi:ssa, scsi:sbp, scsi:srp, scsi:iscsi, scsi:sas, scsi:adt, scsi:ata,
       scsi:unspec,  ccw, cciss, nvme, and undef.  The protocol that a path is
       using can be viewed by running 'multipathd show paths format "%d %P"'

blacklist_exceptions section:

       protocol         Regular expression of the protocol to be  whitelisted.
                        See  the  blacklist  section  for a list of recognized

Comment 9 Ala Hino 2018-07-09 05:43:05 UTC

Two questions please:
Could this be backported to RHEL 7.5?
Could this be pushed to Fedora 28?

Comment 10 Ben Marzinski 2018-07-12 18:07:38 UTC
Yeah. I think so. The change is pretty self contained. Obviously, the 7.5 change would need to get approved as a zstream. Could you open bugzillas for this?

Comment 12 Steve Almy 2018-07-23 16:48:28 UTC
*** Bug 1600672 has been marked as a duplicate of this bug. ***

Comment 26 errata-xmlrpc 2018-10-30 11:27:36 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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.