os-brick/etc/os-brick
Walter A. Boring IV 3ea86f7d60 FC Stop calling multipath command line
This patch changes how we discover Multipath devices for
FibreChannel volume attaches.

Running multipath -l <device> can become slower and slower
as more and more volumes are attached to a host.  To overcome this,
there are ways of discovering multipath device paths without
using the multipath -l command at all.

When multipath daemon is running, and it discovers new volumes,
it will create new device paths for the multipath device associated
with that new volume.   Those multipath device paths are predictable
and show up after the multipath device is created.  This avoids
the repeated looping calls to multipath -l to discover the same paths.

SCSI volumes have a WWN that's supposed to be in page 0x83 on the volume
itself according to the SCSI SPC-3 spec.  That WWN is where the multipath
daemon gets it's multipath ID from and what is used to create the predictable
multipath device paths on the system.

When multipath friendly names are disabled, you get paths of
 /dev/disk/by-id/dm-uuid-mpath-<WWN>
 /dev/disk/by-id/scsi-<WWN>
 /dev/mapper/<WWN>

When multipath friendly names are enabled, you get paths of
 /dev/disk/by-id/dm-uuid-mpath-<WWN>
 /dev/disk/by-id/dm-name-mpath<N>
 /dev/disk/by-id/scsi-mpath<N>
 /dev/mapper/mpath<N>

This patch does 3 different attempts to find a multipath device path to
use.

First it looks in the common location of:
 /dev/disk/by-id/dm-uuid-mpath-<WWN>

Then in the non friendly name path of:
 /dev/mapper/<WWN>

And lastly using the fallback of calling multipath -l <device> to get:
 /dev/mapper/mpath<N>

Partial-Bug: 1487169
Change-Id: I9a9fffcb6882b1c2750b1e7927475093bde36d04
2015-08-27 16:55:36 +00:00
..
rootwrap.d FC Stop calling multipath command line 2015-08-27 16:55:36 +00:00