Chapter 3. Setting up DM Multipath

Before setting up DM Multipath on your system, ensure that your system has been updated and includes the device-mapper-multipath package.

3.1. Basic DM Multipath setup

You set up DM Multipath with the mpathconf utility, which creates the multipath configuration file /etc/multipath.conf.

  • If the /etc/multipath.conf file already exists, the mpathconf utility will edit it.
  • If the /etc/multipath.conf file does not exist, the mpathconf utility will create the /etc/multipath.conf file from scratch.

For more information on the mpathconf utility, see the mpathconf(8) man page.

If you do not need to edit the /etc/multipath.conf file, you can set up DM Multipath for a basic failover configuration by running the following mpathconf command. This command enables the multipath configuration file and starts the multipathd daemon.

# mpathconf --enable --with_multipathd y

If you need to edit the /etc/multipath.conf file before starting the multipathd daemon. use the following procedure to set up DM Multipath for a basic failover configuration.

  1. Enter the mpathconf command with the --enable option specified:

    # mpathconf --enable

    For information on additional options to the mpathconf command you may require, see the mpathconf(8) man page or enter the mpathconf command with the --help option specified.

    # mpathconf --help
    usage: /sbin/mpathconf <command>
    
    Commands:
    Enable: --enable
    Disable: --disable
    Set user_friendly_names (Default y): --user_friendly_names <y|n>
    Set find_multipaths (Default y): --find_multipaths <y|n>
    Load the dm-multipath modules on enable (Default y): --with_module  <y|n>
    start/stop/reload multipathd (Default n): --with_multipathd  <y|n>
  2. Edit the /etc/multipath.conf file if necessary. The default settings for DM Multipath are compiled in to the system and do not need to be explicitly set in the /etc/multipath.conf file.

    The default value of path_grouping_policy is set to failover, so in this example you do not need to edit the /etc/multipath.conf file.

    The initial defaults section of the configuration file configures your system so that the names of the multipath devices are of the form /dev/mapper/mpathn; without this setting, the names of the multipath devices would be aliased to the WWID of the device. If you do not want to use user friendly names, you can enter the following command:

    # mpathconf --enable --user_friendly_names n
  3. Save the configuration file and exit the editor, if necessary.
  4. Execute the following command:

    # systemctl start multipathd.service
Note

If you find that you need to edit the multipath configuration file after you have started the multipath daemon, you must execute the systemctl reload multipathd.service command for the changes to take effect.

3.2. Ignoring local disks when generating multipath devices

Some machines have local SCSI cards for their internal disks. DM Multipath is not recommended for these devices. If you set the find_multipaths configuration parameter to on, you should not have to blacklist these devices. For information on the find_multipaths configuration parameter and the meaning of the values to which you can set this parameter to, see the multipath.conf(5) man page.

If you do not set the find_multipaths configuration parameter to on, you can use the following procedure to modify the multipath configuration file to ignore the local disks when configuring multipath.

  1. Determine which disks are the internal disks and mark them as the ones to blacklist.

    In this example, /dev/sda is the internal disk. Note that as originally configured in the default multipath configuration file, executing the multipath -v2 command shows the local disk, /dev/sda, in the multipath map.

    This examples specifies the -d option of the multipath command to indicate that this is a dry run that will not create the multipath devices.

    # multipath -v2 -d
    : SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 undef WINSYS,SF2372
    size=33 GB features="0" hwhandler="0" wp=undef
    `-- policy='round-robin 0' prio=1 status=undef
      |- 0:0:0:0 sda 8:0  [---------
    
    : 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372
    size=12G features='0' hwhandler='0' wp=undef
    `-- policy='round-robin 0' prio=1 status=undef
      |- 2:0:0:0 sdb 8:16  undef ready  running
      `- 3:0:0:0 sdf 8:80 undef ready  running
    
    : 3600a0b80001327510000009a436215ec undef WINSYS,SF2372
    size=12G features='0' hwhandler='0' wp=undef
    `-- policy='round-robin 0' prio=1 status=undef
      |- 2:0:0:1 sdc 8:32 undef ready  running
      `- 3:0:0:1 sdg 8:96 undef ready  running
    
    : 3600a0b80001327d800000070436216b3 undef WINSYS,SF2372
    size=12G features='0' hwhandler='0' wp=undef
    `-- policy='round-robin 0' prio=1 status=undef
      |- 2:0:0:2 sdd 8:48 undef ready  running
      `- 3:0:0:2 sdg 8:112 undef ready  running
    
    : 3600a0b80001327510000009b4362163e undef WINSYS,SF2372
    size=12G features='0' hwhandler='0' wp=undef
    `-+- policy='round-robin 0' prio=1 status=undef
      |- 2:0:0:3 sdd 8:64 undef ready  running
      `- 3:0:0:3 sdg 8:128 undef ready  running
  2. In order to prevent the device mapper from mapping /dev/sda in its multipath maps, edit the blacklist section of the /etc/multipath.conf file to include this device. Although you could blacklist the sda device using a devnode type, that would not be a safe procedure since /dev/sda is not guaranteed to be the same on reboot. To blacklist individual devices, you can blacklist using the WWID of that device.

    Note that in the output to the multipath -v2 command, the WWID of the /dev/sda device is SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1. To blacklist this device, include the following in the /etc/multipath.conf file.

    blacklist {
          wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
    }
  3. After you have updated the /etc/multipath.conf file, you must manually tell the multipathd daemon to reload the file. The following command reloads the updated /etc/multipath.conf file.

    # systemctl reload multipathd.service

3.3. Configuring additional storage devices

By default, DM Multipath includes support for the most common storage arrays that themselves support DM Multipath. For information on the default configuration value, including supported devices, run either of the following commands.

# multipathd show config
# multipath -t

If you need to add a storage device that is not supported by default as a known multipath device, edit the /etc/multipath.conf file and insert the appropriate device information.

For example, to add information about the HP Open-V series the entry looks like this. This example sets the device to queue for a minute (or 12 retries and 5 seconds per retry) after all paths have failed.

devices {
        device {
                vendor "HP"
                product "OPEN-V"
                no_path_retry 12
        }
}

3.4. Setting up multipathing in the initramfs file system

You can set up multipathing in the initramfs file system. After configuring multipath, you can rebuild the initramfs file system with the multipath configuration files by executing the dracut command with the following options:

# dracut --force --add multipath

If you run multipath from the initramfs file system and you make any changes to the multipath configuration files, you must rebuild the initramfs file system for the changes to take effect.