Linux Device Mapper-Multipathing (DM-MP)

The Linux® Device Mapper-Multipathing (DM-MP) provides multipathing for Linux block devices and is the preferred solution for multipathing with FCP/SCSI devices for Linux on z Systems®.

The multipathd user-space daemon can use multiple physical I/O paths between server nodes and FCP/SCSI devices in storage subsystems. The aggregated paths appear as a single device via the Linux device mapper. DM-MP also supports request re-routing (failover), and request balancing across available paths.

The following Linux commands display a single FCP/SCSI device that can be addressed via four paths by using four different FCP device and WWPN combinations. Note that the SCSI logical unit number (LUN) is the same for the listed SCSI device. Such a setup is a prerequisite for performing DM-MP.

In the following examples:
  • lsscsi lists the SCSI devices and the paths to these devices.
  • lszfcp -D lists the SCSI devices and zfcp units.

# lsscsi 
[0:0:32:1086865428]disk    IBM      2107900          .307  /dev/sda 
[1:0:26:1086865428]disk    IBM      2107900          .307  /dev/sdb 
[2:0:29:1086865428]disk    IBM      2107900          .307  /dev/sdc 
[3:0:16:1086865428]disk    IBM      2107900          .307  /dev/sdd


# lszfp -D
0.0.1731/0x500507630900c7c1/0x401440c800000000 0:0:32:1086865428
0.0.17b1/0x500507630903c7c1/0x401440c800000000 1:0:26:1086865428
0.0.1831/0x500507630908c7c1/0x401440c800000000 2:0:29:1086865428
0.0.5031/0x50050763090bc7c1/0x401440c800000000 3:0:16:1086865428

Enabling DM-MP

DM-MP was enabled with the following three steps:

Step 1: Ensure the multipathd daemon is running.

# rcmultipathd status
Checking for multipathd:               running
Step 2: Create a multipathing configuration in /etc/multipath.conf. The following sample is used throughout this case study.

defaults {
        user_friendly_names yes
}
        blacklist {
devnode "*"
}
blacklist_exceptions {
        devnode "^sd[a-z]+[0-9]*"
                device { 
                vendor "IBM"
                product "S/390.*"
        }
}
devices {
        device {
                vendor "IBM"
                product "^2107900"
                path_grouping_policy "multibus"
                path_checker "tur"
                features "1 queue_if_no_path"
                rr_min_io_rq "100"
                # from device defaults
                hardware_handler "0"
                prio "const"
                rr_weight "uniform"
        }
}

multipaths {
        multipath {
                wwid "36005076309ffc7c100000000000014c8"
                alias "scsi14c8"
        }   
      ...
}
The sample contains these variables and settings:
defaults section
Defines default values for attributes.
blacklist section
Defines which devices should be excluded for multipathing discovery.
blacklist_exceptions section
Defines which devices should be included for multipathing discovery.
devices section
Defines the device-specific settings:
path_grouping_policy "multibus"
Traffic is load-balanced across all active paths in the group.
path_checker "tur"
The method used to determine the paths state. “tur” is the preferred setting if the LUN supports it.
features "1 queue_if_no_path”
Set up I/O queuing for scenarios where all paths fail.
rr_min_io_rq "100"
Specifies the number of I/O requests to route to a path before switching to the next path in the current path group.
multipaths section
Defines the multipath topologies indexed by a World Wide Identifier (wwid) The optional alias specifies a symbolic name for the multipath map.
Step 3: Check the status of DM-MP after the changes have been applied (the number of paths, and so on).
# multipathd -k'show topo'
scsi14c8 (36005076309ffc7c100000000000014c8) dm-0 IBM     ,2107900         
size=256G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  |- 0:0:21:1086865428 sda 8:0  active ready running
  |- 1:0:21:1086865428 sdb 8:16 active ready running
  |- 2:0:18:1086865428 sdc 8:32 active ready running
  `- 3:0:17:1086865428 sdd 8:48 active ready running

# multipathd -k'show maps status'
name     failback queueing paths dm-st  write_prot
scsi14c8 -        on       4     active rw
Note that changes to /etc/multipath.conf are not effective when multipathd is running. To apply the changes:
  1. Stop the multipathd daemon and clear the multipath bindings.
  2. Trigger the creation of new multipath maps.
  3. Restart multipathd.
For further information, proceed to the IBM® Knowledge Center topic describing how to use FCP-attached SCSI devices with Linux on System z®:
https://www.ibm.com/docs/en/linux-on-systems?topic=lo-how-use-fc-attached-scsi-devices-linux-system-z