Skip to contentSkip to conversation

multipath: change default configuration parameters

PATCH Superseded Benjamin Marzinski 4 participants 8 messages Jan 8, 2013 – Jan 17, 2013 Device mapper

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 multipath: change default configuration parameters

This patch makes multipath devices default to setting fast_io_fail, switches the default selector to service-time and removes the round-robin setting of the builtin device configurations. The goal is to give multipath devices better performance "out of the box".

---
 libmultipath/config.c   |    1 
 libmultipath/defaults.h |    2 -
 libmultipath/hwtable.c  |   65 ------------------------------------------------
 3 files changed, 2 insertions(+), 66 deletions(-)
libmultipath/config.c +1 -0
Index: multipath-tools-120821/libmultipath/config.c
===================================================================
@@ -516,6 +516,7 @@ load_config (char * file)
 	conf->reassign_maps = DEFAULT_REASSIGN_MAPS;
 	conf->checkint = DEFAULT_CHECKINT;
 	conf->max_checkint = MAX_CHECKINT(conf->checkint);
+	conf->fast_io_fail = 5;
 
 	/*
 	 * preload default hwtable
libmultipath/hwtable.c +0 -65

455 lines not on this page · raw message

libmultipath/defaults.h +1 -1
Index: multipath-tools-120821/libmultipath/defaults.h
===================================================================
@@ -1,7 +1,7 @@
 #define DEFAULT_UID_ATTRIBUTE	"ID_SERIAL"
 #define DEFAULT_UDEVDIR		"/dev"
 #define DEFAULT_MULTIPATHDIR	"/" LIB_STRING "/multipath"
-#define DEFAULT_SELECTOR	"round-robin 0"
+#define DEFAULT_SELECTOR	"service-time 0"
 #define DEFAULT_ALIAS_PREFIX	"mpath"
 #define DEFAULT_FEATURES	"0"
 #define DEFAULT_HWHANDLER	"0"
#1 lore raw
Quoted 11 lines · Benjamin Marzinski

This patch makes multipath devices default to setting fast_io_fail, switches the default selector to service-time and removes the round-robin setting of the builtin device configurations. The goal is to give multipath devices better performance "out of the box".

---
 libmultipath/config.c   |    1 
 libmultipath/defaults.h |    2 -
 libmultipath/hwtable.c  |   65 ------------------------------------------------
 3 files changed, 2 insertions(+), 66 deletions(-)

These changes should also translate to the multipath.conf.defaults file.

#2 lore raw
Quoted 7 lines · Xose Vazquez Perez
Quoted 5 lines · Benjamin Marzinski

This patch makes multipath devices default to setting fast_io_fail, switches the default selector to service-time and removes the round-robin setting of the builtin device configurations. The goal is to give multipath devices better performance "out of the box".

Quoted 8 lines
Quoted 6 lines
---
 libmultipath/config.c   |    1 
 libmultipath/defaults.h |    2 -
 libmultipath/hwtable.c  |   65 ------------------------------------------------
 3 files changed, 2 insertions(+), 66 deletions(-)

These changes should also translate to the multipath.conf.defaults file.

I pushed a patch to resync the multipath.conf.defaults using the "multipathd show config" output.

Best regards,
Christophe Varoqui

#3 lore raw
Quoted 15 lines · Christophe Varoqui

I pushed a patch to resync the multipath.conf.defaults using the "multipathd show config" output.

multipath.conf.defaults +0 -6
@@ -2,775 +2,863 @@
 # overwrite these values in your config file.
 
 #defaults {
-#      udev_dir                /dev
-#      polling_interval        5
-#      path_selector           "round-robin 0"
-#      path_grouping_policy    failover
-#      getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
-#      prio                    const

multipath.conf.defaults line 7

Quoted 10 lines
multipath.conf.defaults +3 -7
-#      prio_args               ""
-#      path_checker            directio
-#      rr_min_io               1000
-#      rr_weight               uniform
-#      failback                manual
-#      no_path_retry           fail
-#      user_friendly_names     no
+#      verbosity 2
+#      polling_interval 5
+#      multipath_dir "/lib64/multipath"

multipath_dir should be removed, it's generated at compile time.

#5 lore raw
In reply to Christophe Varoqui
Quoted 6 lines · Christophe Varoqui

I pushed a patch to resync the multipath.conf.defaults using the "multipathd show config" output.

multipath.conf.defaults line 9

Quoted 8 lines
multipath.conf.defaults +0 -5
@@ -2,775 +2,863 @@
 # overwrite these values in your config file.
 
 #defaults {
-#      udev_dir                /dev
-#      polling_interval        5
-#      path_selector           "round-robin 0"
-#      path_grouping_policy    failover
-#      getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"

scsi_id is going to be replaced in systemd(recently udev was included in systemd).

See sg_inq(--export option) from sg3_utils.

#4 lore raw
In reply to Xose Vazquez Perez
Quoted 21 lines · Xose Vazquez Perez
Quoted 19 lines · Christophe Varoqui

I pushed a patch to resync the multipath.conf.defaults using the "multipathd show config" output.

multipath.conf.defaults +0 -10
@@ -2,775 +2,863 @@
 # overwrite these values in your config file.
 
 #defaults {
-#      udev_dir                /dev
-#      polling_interval        5
-#      path_selector           "round-robin 0"
-#      path_grouping_policy    failover
-#      getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
-#      prio                    const
-#      prio_args               ""
-#      path_checker            directio
-#      rr_min_io               1000
-#      rr_weight               uniform
Quoted 8 lines

multipath.conf.defaults line 7

Quoted 6 lines
multipath.conf.defaults +3 -3
-#      failback                manual
-#      no_path_retry           fail
-#      user_friendly_names     no
+#      verbosity 2
+#      polling_interval 5
+#      multipath_dir "/lib64/multipath"

multipath_dir should be removed, it's generated at compile time.

True. Applied.

#6 lore raw
In reply to Xose Vazquez Perez

On mar., 2013-01-15 at 23:14 +0100, Xose Vazquez Perez wrote:
...

Quoted 4 lines

scsi_id is going to be replaced in systemd(recently udev was included in systemd).

See sg_inq(--export option) from sg3_utils.

We will need to patch sg_inq to report a denser id than the documented SCSI_IDENT_<assoc>_<type>=<ident>

Time to launch a debate over the pertinence to maintain the '3' prefix scsi_id insisted on prepending to the wwids ... Lennart will take the blame without flinching I'm sure ;)

Regards,
Christophe Varoqui
www.opensvc.com

#7 lore raw
Quoted 10 lines · Christophe Varoqui

On mar., 2013-01-15 at 23:14 +0100, Xose Vazquez Perez wrote:
...

Quoted 4 lines

scsi_id is going to be replaced in systemd(recently udev was included in systemd).

See sg_inq(--export option) from sg3_utils.

We will need to patch sg_inq to report a denser id than the documented SCSI_IDENT_<assoc>_<type>=<ident>

Why? It took me ages to implement that one properly.
And it's only strings, which can be expanded at will.
Plus I have a set of udev rules mangling those into the usual ID_XXX variables.

I don't see why we need to change that ...

Quoted 4 lines

Time to launch a debate over the pertinence to maintain the '3' prefix scsi_id insisted on prepending to the wwids ... Lennart will take the blame without flinching I'm sure ;)

It's not '3'.

The '3' is the VPD designator ID as defined in the spec. And it's attached there so that you can differentiate between several IDs, which might be identical otherwise.

The original idea behind the prefix was that each ID has a different level of 'uniqueness'. Basically, there are 5 possible designator IDs for the LUN:

0: Vendor specific
1: T10 Vendor ID based
2: EUI-64 based
3: NAA
8: SCSI Name string

of which 0, 1, and 8 are basically arbitrary. We only have a guaranteed unique ID when the designator is of type 2 or 3. So prefixing the designator number allows you to figure out whether it's a good idea for using that ID.

Mind you, that was when all was encoded in scsi_id.
Now that's all open-coded with udev rules you have different variables for each ID, so it's easy to figure out.

But sorry, we can't change that.
Upgrade will be _HELL_ if you do that.

Btw, a patch to the udev rules is attached. It's not yet included in the upstream sources as Kay and I are still discussing whether we should split the original rule set.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
rules/rules.d/60-persistent-storage.rules +21 -3
index 1c4c2b2..a8377c6 100644
@@ -38,17 +38,35 @@ KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program
 # ATA devices using the "scsi" subsystem
 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode"
 # scsi devices
-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"
-KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss"
+KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export  $tempnode", ENV{ID_BUS}="scsi"
+KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_BUS}="cciss"
+# Select which identifier to use per default
+# 1: NAA IEEE Registered Extended identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="6*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 2: NAA IEEE Registered identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="5*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 3: Unspecified NAA identfier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="?*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 4: EUI-64 identifer
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_EUI64}=="?*", ENV{ID_SERIAL}="2$env{SCSI_IDENT_LUN_EUI64}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_EUI64}"
+# 5: SCSI name identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAME}=="?*", ENV{ID_SERIAL}="8$env{SCSI_IDENT_LUN_NAME}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAME}"
+# 6: T10 Vendor identifer
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_T10}=="?*", ENV{ID_SERIAL}="1$env{SCSI_IDENT_LUN_T10}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_T10}"
+# 7: Vendor-specific identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_VENDOR}=="?*", ENV{ID_SERIAL}="0$env{SCSI_IDENT_LUN_VENDOR}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_VENDOR}"
 KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
 KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
 
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export -p 0x80 $tempnode", ENV{ID_SCSI_SERIAL}="$env{SCSI_IDENT_SERIAL}"
+KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export -p 0x80 $tempnode", ENV{ID_SCSI_SERIAL}="$env{SCSI_IDENT_SERIAL}"
+
 # firewire
 KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
 KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
 
 # scsi compat links for ATA devices
-KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", ENV{SCSI_IDENT_SERIAL}=="?*", ENV{ID_SCSI_COMPAT}="$env{SCSI_IDENT_SERIAL}", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
 KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
 
 KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"