Chapter 1. Overview of Device Mapper Multipathing

With Device mapper multipathing (DM Multipath), you can configure multiple I/O paths between server nodes and storage arrays into a single device. These I/O paths are physical Storage Area Network (SAN) connections that can include separate cables, switches, and controllers. Multipathing aggregates the I/O paths and creates a new device that consists of the aggregated paths.

DM Multipath provides:

  • Redundancy

    DM Multipath can provide failover in an active/passive configuration. In an active/passive configuration, only half the paths are used at any time for I/O. If any element of an I/O path (the cable, switch, or controller) fails, DM Multipath switches to an alternate path.

  • Improved Performance

    DM Multipath can be configured in an active/active mode, where I/O is spread over the paths in a round-robin fashion. In some configurations, DM Multipath can detect loading on the I/O paths and dynamically rebalance the load.

1.1. Different DM Multipath configurations

Following are the few DM Multipath configuration examples:

1.1.1. Active/Passive multipath configuration with one RAID device

In this configuration, there are two Host Bus Adapters (HBAs) on the server, two SAN switches, and two RAID controllers. Following are the possible failure in this configuration:

  • HBA failure
  • Fibre Channel cable failure
  • SAN switch failure
  • Array controller port failure

With DM Multipath configured, a failure at any of these points causes DM Multipath to switch to the alternate I/O path. Figure 1.1, “Active/Passive multipath configuration with one RAID device” describes the configuration with two I/O paths from the server to a RAID device. Here, there is one I/O path that goes through hba1, SAN1, and cntrlr1 and a second I/O path that goes through hba2, SAN2, and cntrlr2.

Figure 1.1. Active/Passive multipath configuration with one RAID device

active passive multipath configuration with one raid device

1.1.2. Active/Passive multipath configuration with two RAID devices

In this configuration, there are two HBAs on the server, two SAN switches, and two RAID devices with two RAID controllers each. With DM Multipath configured, a failure at any of the points of the I/O path to either of the RAID devices causes DM Multipath to switch to the alternate I/O path for that device. Figure 1.2, “Active/Passive multipath configuration with two RAID device” describes the configuration with two I/O paths to each RAID device. Here, there are two I/O paths to each RAID device.

Figure 1.2. Active/Passive multipath configuration with two RAID device

active passive multipath configuration with two raid device

1.1.3. Active/Active multipath configuration with one RAID device

In this configuration, there are two HBAs on the server, two SAN switch, and two RAID controllers. Figure 1.3, “Active/Active multipath configuration with one RAID device” describes the configuration with two I/O paths from the server to a storage device. Here, I/O can be spread among these two paths.

Figure 1.3. Active/Active multipath configuration with one RAID device

active passive multipath configuration with one raid device

1.2. DM Multipath components

Table 1.1, “Components of DM Multipath” describes the DM Multipath components.

Table 1.1. Components of DM Multipath

Component

Description

dm_multipath kernel module

Reroutes I/O and supports failover for paths and path groups.

mpathconf utility

Configures and enables device mapper multipathing.

multipath command

Lists and configures the multipath devices. It is also executed by udev whenever a block device is added, to determine if the device should be part of a multipath device or not.

multipathd daemon

Automatically creates and removes multipath devices and monitors paths; as paths fail and come back, it may update the multipath device. Allows interactive changes to multipath devices. Reload the service if there are any changes to the /etc/multipath.conf file.

kpartx command

Creates device mapper devices for the partitions on a device. This command is automatically executed by udev when multipath devices are created to create partition devices on top of them. The kpartx command is provided in its own package, but the device-mapper-multipath package depends on it.

mpathpersist

Sets up SCSI-3 persistent reservations on multipath devices. This command works similarly to the way sg_persist works for SCSI devices that are not multipathed, but it handles setting persistent reservations on all paths of a multipath device. It coordinates with multipathd to ensure that the reservations are set up correctly on paths that are added later. To use this functionality, the reservation_key attribute must be defined in the /etc/multipath.conf file. Otherwise the multipathd daemon will not check for persistent reservations for newly discovered paths or reinstated paths.

Additional resources

  • The multipath man page.
  • The multipathd man page.
  • The /etc/multipath.conf file.