Linux DM Multipath
| Company type | Software feature |
|---|---|
| Industry | Computer software, Storage technology |
| Founded | June 17, 2005 |
| Founder | Joe Thornber |
| Headquarters | Linux environment |
| Products | Multipath I/O for block devices |
| Owner | Red Hat (maintainer) |
Device Mapper Multipath Input Output (DM-MPIO), also referred to as DM-Multipathing, provides failover capabilities and load distribution for input/output operations by employing multipath I/O within the Linux environment for block devices. Utilizing the device-mapper infrastructure, the multipathd daemon oversees multiple redundant network routes, guaranteeing uninterrupted access and improved bandwidth between the host system and block storage devices. Upon detecting path failures, DM-MPIO redirects block I/O to alternative routes and balances workload across all available connections. This technology is frequently implemented in Fibre Channel (FC) and iSCSI SAN setups to support resilient storage solutions by optimizing path utilization and reducing service interruptions.
Considerations
In scenarios where Linux DM-MPIO operates within a datacenter featuring diverse operating system platforms and varying multipath implementations, managing paths effectively is essential:
- Load balancing — Allocates I/O tasks evenly across hardware paths to enhance throughput, minimize latency, and maximize resource efficiency.
- Path failover and recovery — Employs redundant communication channels to reroute read/write operations when a path becomes unavailable.
History
The DM-MPIO project began as a patch developed by Joe Thornber and was later maintained by Alasdair G Kergon at Red Hat. It was integrated into the Linux kernel mainline starting with version 2.6.12, released on June 17, 2005.
Components
Linux DM-MPIO consists of both kernel-level and user-space elements:
- Kernel – The device-mapper framework facilitates block device abstraction.
dm-multipath– kernel module that implements the multipath target functionality.
- User-space – The multipath-tools package controls multipathed devices through device-mapper management:
- Multipath: responsible for scanning and assembling multipathed devices, updating device-mapper configurations.
- Multipathd: daemon that monitors path status changes; marks paths as failed when necessary and can restore them based on configured failback policies.
- Devmap-name: assigns user-friendly device names to udev for devmaps.
- Kpartx: maps linear devmaps to partitions, enabling partition-aware multipath configurations.
- Multipath.conf: configuration file used by the multipath daemon to override default settings.
Configuration file
The /etc/multipath.conf file allows administrators to customize DM-MPIO behavior. Both the multipath utility and multipathd daemon reference this file during device setup. Any modifications require rerunning multipath for changes to apply.
This configuration file is divided into five sections:
- System-wide defaults (defaults): overrides global default parameters.
- Blacklisted devices (blacklist): specifies devices excluded from DM-MPIO management.
- Blacklist exceptions (blacklist_exceptions): lists devices that are included despite blacklist rules.
- Storage controller definitions (devices): applies settings based on "Vendor" and "Product" identifiers.
- Device-specific configurations (multipaths): allows fine-grained tuning of individual LUN behavior.
Terminology
- HBA: Host bus adapters serve as the physical interface linking the I/O host bus of Fibre Channel devices to the Fibre Channel fabric.
- Path: The connection route from the server through an HBA to a particular LUN.
- DM Path States: Device mapper categorizes path conditions into two states:
- Active: The most recent I/O operation succeeded; equivalent to a ready status.
- Failed: The last I/O operation did not complete successfully; equivalent to a faulted status.
- Failover: The process of switching activity to an operational path when another fails.
- Failback: When a previously failed path recovers, multipathd can switch back depending on configured policies.
- Failback Policy: Defined within multipath.conf with four possible modes:
- Immediate: Switches back instantly to the highest priority path.
- Manual: Requires administrator action; failed paths are not monitored automatically.
- Followover (cluster-aware): Automatically fails back only if the primary path in a group is active, avoiding unintended node failbacks.
- Timed: Delays failback for a specified duration before reverting to the preferred path.
- Active/Active: Storage controllers both operate concurrently handling I/O traffic.
- Active/Passive: Only one controller actively processes I/O while the other remains on standby.
- LUN: SCSI Logical Unit Number
- WWID: Worldwide Identifier uniquely distinguishes each multipathed device globally.
Further reading
- Michael, T., Kabir, R., Giles, J., and Hull, J. (2006) Setting Up Linux for Multipath I/O Functionality.
- Goggin, E., Kergon, A., Varoqui, C., and Olien, D. (2005) Proceedings on Linux Multipathing.
- Red Hat Documentation. DM Multipath in Red Hat Enterprise Linux 6.
- Varoqui, C. (2010) Overview of the Linux Multipath Architecture.