• Aucun résultat trouvé

The DM-Multipath Configuration File

Dans le document Guida a Ubuntu Server (Page 69-73)

Tabella 5.1. Priority Checker Conversion

4. The DM-Multipath Configuration File

By default, DM-Multipath provides configuration values for the most common uses of multipathing.

In addition, DM-Multipath includes support for the most common storage arrays that support DM-Multipath. The default configuration values and the supported devices can be found in the

multipath.conf.defaults file.

You can override the default configuration values for DM-Multipath by editing the /etc/

multipath.conf configuration file. If necessary, you can also add a storage array that is not supported by default to the configuration file. This chapter provides information on parsing and modifying the

multipath.conf file. It contains sections on the following topics:

• Configuration File Overview [63]

• Configuration File Blacklist [64]

• Configuration File Defaults [66]

• Configuration File Multipath Attributes [70]

• Configuration File Devices [71]

In the multipath configuration file, you need to specify only the sections that you need for your configuration, or that you wish to change from the default values specified in the

multipath.conf.defaults file. If there are sections of the file that are not relevant to your environment or for which you do not need to override the default values, you can leave them commented out, as they are in the initial file.

The configuration file allows regular expression description syntax.

An annotated version of the configuration file can be found in /usr/share/doc/multipath-tools/

examples/multipath.conf.annotated.gz.

4.1. Configuration File Overview

The multipath configuration file is divided into the following sections:

blacklist

Listing of specific devices that will not be considered for multipath.

blacklist_exceptions

Listing of multipath candidates that would otherwise be blacklisted according to the parameters of the blacklist section.

defaults

General default settings for DM-Multipath.

multipath

Settings for the characteristics of individual multipath devices. These values overwrite what is specified in the defaults and devices sections of the configuration file.

devices

Settings for the individual storage controllers. These values overwrite what is specified in the defaults section of the configuration file. If you are using a storage array that is not supported by default, you may need to create a devices subsection for your array.

When the system determines the attributes of a multipath device, first it checks the multipath settings, then the per devices settings, then the multipath system defaults.

4.2. Configuration File Blacklist

The blacklist section of the multipath configuration file specifies the devices that will not be used when the system configures multipath devices. Devices that are blacklisted will not be grouped into a multipath device.

• If you do need to blacklist devices, you can do so according to the following criteria:

• By WWID, as described Blacklisting By WWID [64]

• By device name, as described in Blacklisting By Device Name [64]

• By device type, as described in Blacklisting By Device Type [65]

By default, a variety of device types are blacklisted, even after you comment out the initial blacklist section of the configuration file. For information, see Blacklisting By Device Name [64]

4.2.1. Blacklisting By WWID

You can specify individual devices to blacklist by their World-Wide IDentification with a wwid entry in the blacklist section of the configuration file.

The following example shows the lines in the configuration file that would blacklist a device with a WWID of 26353900f02796769.

blacklist {

wwid 26353900f02796769 }

4.2.2. Blacklisting By Device Name

You can blacklist device types by device name so that they will not be grouped into a multipath device by specifying a devnode entry in the blacklist section of the configuration file.

The following example shows the lines in the configuration file that would blacklist all SCSI devices, since it blacklists all sd* devices.

blacklist {

devnode "^sd[a-z]"

}

You can use a devnode entry in the blacklist section of the configuration file to specify individual devices to blacklist rather than all devices of a specific type. This is not recommended, however, since unless it is statically mapped by udev rules, there is no guarantee that a specific device will have the same name on reboot. For example, a device name could change from /dev/sda to /dev/sdb on reboot.

By default, the following devnode entries are compiled in the default blacklist; the devices that these entries blacklist do not generally support DM-Multipath. To enable multipathing on any of these devices, you would need to specify them in the blacklist_exceptions section of the configuration file, as described in Blacklist Exceptions [65]

blacklist {

devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"

devnode "^hd[a-z]"

}

4.2.3. Blacklisting By Device Type

You can specify specific device types in the blacklist section of the configuration file with a device section. The following example blacklists all IBM DS4200 and HP devices.

blacklist {

You can use the blacklist_exceptions section of the configuration file to enable multipathing on devices that have been blacklisted by default.

For example, if you have a large number of devices and want to multipath only one of them (with the WWID of 3600d0230000000000e13955cc3757803), instead of individually blacklisting each of the devices except the one you want, you could instead blacklist all of them, and then allow only the one you want by adding the following lines to the /etc/multipath.conf file.

blacklist { wwid "*"

}

blacklist_exceptions {

wwid "3600d0230000000000e13955cc3757803"

}

When specifying devices in the blacklist_exceptions section of the configuration file, you must specify the exceptions in the same way they were specified in the blacklist. For example, a WWID exception will not apply to devices specified by a devnode blacklist entry, even if the blacklisted device is associated with that WWID. Similarly, devnode exceptions apply only to devnode entries, and device exceptions apply only to device entries.

4.3. Configuration File Defaults

The /etc/multipath.conf configuration file includes a defaults section that sets the user_friendly_names parameter to yes, as follows.

defaults {

user_friendly_names yes }

This overwrites the default value of the user_friendly_names parameter.

The configuration file includes a template of configuration defaults. This section is commented out, as follows.

To overwrite the default value for any of the configuration parameters, you can copy the relevant line from this template into the defaults section and uncomment it. For example, to overwrite the path_grouping_policy parameter so that it is multibus rather than the default value of failover, copy the appropriate line from the template to the initial defaults section of the configuration file, and uncomment it, as follows.

defaults {

user_friendly_names yes

path_grouping_policy multibus }

Table Multipath Configuration Defaults [67] describes the attributes that are set in the defaults section of the multipath.conf configuration file. These values are used by DM-Multipath unless they are overwritten by the attributes specified in the devices and multipaths sections of the

multipath.conf file.

Dans le document Guida a Ubuntu Server (Page 69-73)