For a generic dm-multipath configuration, see Device mapper multipath configuration, in this article, we are going to just describe how to config device

By default, DM-Multipath includes support for the most common storage arrays that support DM-Multipath. The default configuration values, including supported devices, can be found in the multipath.conf.defaults file.

In any case, be sure you blacklist local disk before you move ahead for external storage device configuration.

Configuring Storage Devices

In any case, 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, where %n is the device name:

devices {
     device {
            vendor "HP"
            product "OPEN-V."
            getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
     }
}

For more information on the devices section of the configuration file, see Section Configuration File Devices.

Configuration File Devices

Table Device Attributes shows the attributes that you can set for each individual storage device in the devices section of the multipath.conf configuration file. These attributes are used by DM-Multipath unless they are overwritten by the attributes specified in the multipaths section of the multipath.conf file for paths that contain the device. These attributes override the attributes set in the defaults section of the multipath.conf file.

Many devices that support multipathing are included by default in a multipath configuration. The values for the devices that are supported by default are listed in the multipath.conf.defaults file. You probably will not need to modify the values for these devices, but if you do you can overwrite the default values by including an entry in the configuration file for the device that overwrites those values.

To add a device to this section of the configuration file that is not configured automatically by default, you must set the vendor and product parameters. You can find these values by looking at /sys/block/device_name/device/vendor and /sys/block/device_name/device/model where device_name is the device to be multipathed, as in the following example:

# /lib/udev/scsi_id --whitelisted -p0x80 --device=/dev/sda
SIBM     1814      FAStTSQ01100261

Or, get the value direct from sysfs

# cat /sys/block/sda/device/vendor
IBM  
# cat /sys/block/sda/device/model
1814

The additional parameters to specify depend on your specific device. If the device is active/active, you will usually not need to set additional parameters. You may want to set path_grouping_policy to multibus. Other parameters you may need to set are no_path_retry and rr_min_io, as described in Table Multipath Attributes.

If the device is active/passive, but it automatically switches paths with I/O to the passive path, you need to change the checker function to one that does not send I/O to the path to test if it is working (otherwise, your device will keep failing over). This almost always means that you set the path_checker to tur; this works for all SCSI devices that support the Test Unit Ready command, which most do.

If the device needs a special command to switch paths, then configuring this device for multipath requires a hardware handler kernel module. The current available hardware handler is emc. If this is not sufficient for your device, you may not be able to configure the device for multipath.

Device Attributes

Attribute Description
vendor Specifies the vendor name of the storage device to which the device attributes apply, for example COMPAQ.
product Specifies the product name of the storage device to which the device attributes apply, for example HSV110 (C)COMPAQ.
revision Specifies the product revision identifier of the storage device.
product_blacklist Specifies a regular expression used to blacklist devices by product.
hardware_handler

Specifies a module that will be used to perform hardware specific actions when switching path groups or handling I/O errors. Possible values include:

  • 1 emc: hardware handler for EMC storage arrays

  • 1 alua: hardware handler for SCSI-3 ALUA arrays.

  • 1 hp_sw: hardware handler for Compaq/HP controllers.

  • 1 rdac: hardware handler for the LSI/Engenio RDAC controllers.

In addition, the following parameters may be overridden in this device section

  • path_grouping_policy

  • getuid_callout

  • path_selector

  • path_checker

  • features

  • failback

  • prio

  • prio_args

  • no_path_retry

  • rr_min_io

  • rr_weight

  • fast_io_fail_tmo

  • dev_loss_tmo

  • flush_on_last_del

For detail describtion of each parameter above, see multipath configuration parameters explain and their defaults

Whenever a hardware_handler is specified, it is your responsibility to ensure that the appropriate kernel module is loaded to support the specified interface. These modules can be found in /lib/modules/`uname -r`/kernel/drivers/scsi/device_handler/ . The requisite module should be integrated into the initrd to ensure the necessary discovery and failover-failback capacity is available during boot time. Example,

# echo scsi_dh_alua >> /etc/initramfs-tools/modules  ## append module to file
# update-initramfs -u -k all

The following example shows a device entry in the multipath configuration file.

#devices {
#	device {
#		vendor			"COMPAQ  "
#		product			"MSA1000         "
#		path_grouping_policy	multibus
#		path_checker		tur
#		rr_weight		priorities
#	}
#}

The spacing reserved in the vendor, product, and revision fields are significant as multipath is performing a direct match against these attributes, whose format is defined by the SCSI specification, queried by scsi_id command.

Show multipath configuration

To show running multpath configuration, run

# echo 'show config' | multipathd -k

Device user_friendly_names

 By default, is no. If set to yes, specifies that the system should use the /etc/multipath/bindings file to assign a persistent and unique alias to the multipath, or you can config device alias in multipath.conf device section.

multipaths {
          multipath {
                     wwid    360080e50002d26520000067a4f7a3fb8
                     alias   lun0
          }
          multipath {
                     wwid    360080e50002d2124000006d14f7a3f92
                     alias   lun1
          }
...

If no alias configed, multipath will create device in the form of mpathn.For example, multipatha, multipathb etc..

If set to no, specifies that the system should use the WWID as the alias for the multipath.