Bug 636071
Summary: | mpathconf command is not behaving as per man page | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Dominic Geevarghese <dgeevarg> |
Component: | device-mapper-multipath | Assignee: | Ben Marzinski <bmarzins> |
Status: | CLOSED ERRATA | QA Contact: | Jan Malanik <jmalanik> |
Severity: | medium | Docs Contact: | |
Priority: | urgent | ||
Version: | 6.0 | CC: | agk, bdonahue, bmarzins, bmr, christophe.varoqui, coughlan, dwysocha, egoggin, heinzm, jane.lv, jmalanik, junichi.nomura, jvillalo, kueda, lmb, luyu, mbroz, prockai, samuel.kielek, sbradley, snagar, syeghiay, tranlan |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | device-mapper-multipath-0.4.9-32.el6 | Doc Type: | Bug Fix |
Doc Text: |
Previously, if the user edited configuration information with the mpathconf command, the process could have failed. This happened when the user ran the command without any additional arguments due to a conflict of the environment variable DISPLAY with the program variable DISPLAY. With this update, all variables are unset when the script is started and the DISPLAY program variable is renamed. The environment variable DISPLAY remains unchanged when the mpathconf is issued and the command works as expected.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2011-05-19 14:12:02 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 625214, 645519 |
Description
Dominic Geevarghese
2010-09-21 13:38:57 UTC
What happens if you run "mpathconf --enable"? This is working mostly as expected. The manpage states that mpathconf should be called with: mpathconf [commands] [options] The man page also states: If mpathconf is called with no commands, it will display the current configuration. However, mpathconf display needs to return sensible results when the configuration file doesn't exist. I believe dmm is looking in wrong place because I believe we have changed the default location of /etc/multipath.conf to /etc/multipath/multipath.conf $ rpm -ql device-mapper-multipath /etc/multipath /etc/rc.d/init.d/multipathd $ multipath -ll Sep 23 05:07:59 | /etc/multipath.conf does not exist, blacklisting all devices. Sep 23 05:07:59 | A sample multipath.conf file is located at Sep 23 05:07:59 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf Sep 23 05:07:59 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf Sep 23 05:07:59 | DM multipath kernel driver not loaded $ mpathconf --user_friendly_names y $ ll /etc/multipath -a total 16 drwxr-xr-x. 2 root root 4096 Sep 23 05:09 . drwxr-xr-x. 94 root root 4096 Sep 23 05:08 .. -rw-r--r--. 1 root root 2597 Sep 23 05:07 multipath.conf -rw-------. 1 root root 2597 Sep 23 05:09 .multipath.conf.tmp It appears the only problem is with dmm and the docs. --sbradley Hi sbradly, Thanks for your update. Ok. so, dmm configuration file ( multipath.conf ) is moved to /etc/multipath/multipath.conf location and that is a new feature in rhel6. In that case, (a) multipath -ll should show not show incorrect message like " /etc/multipath.conf does not exist ... ". (b) Request you to correct the dmm rhel6 document. Thanks, Dominic No. The configuration file is still at /etc/multipath.conf. If you run # /sbin/mpathconf --enable It should create a multipath.conf file for you. The only problem is that when no configuration file exists, the output from running # /sbin/mpathconf should tell you that no multipath.conf file exists. When no file exists multipath is automatically disabled. So, mpathconf should definitely not be saying the multipathing is enabled. That's what I am fixing with this bugzilla. Thanks for clarification. Apart from mpathconf wrong message, I got two more queries. Per BZ# https://bugzilla.redhat.com/show_bug.cgi?id=636071#c6 the configuration file is still under /etc . But there is no default multipath.conf file placed under /etc/ by default installation. [root@dhcp209-213 ~]# cat /etc/multipath.conf cat: /etc/multipath.conf: No such file or directory (a) Is that expected ?. I have executed mpathconf --enable per BZ# comment. But I failed to find a new /etc/multipath.conf. [root@dhcp209-213 ~]# cat /etc/multipath.conf cat: /etc/multipath.conf: No such file or directory But there is a HIDDEN temporary file created under /etc/multipath [root@dhcp209-213 ~]# cd /etc/multipath/ [root@dhcp209-213 multipath]# ls -la total 12 drwxr-xr-x. 2 root root 4096 Sep 23 20:29 . drwxr-xr-x. 94 root root 4096 Sep 23 20:05 .. -rw-------. 1 root root 2597 Sep 23 20:29 .multipath.conf.tmp (b) I think # mpathconf should not create a HIDDEN config file under /etc/multipath . It should be visible to user along with some indication/msg. Thanks, Dominic ~]# uname -r 2.6.32-71.el6.x86_64 1) Verify device-mapper-multipath is installed. ~]# yum info device-mapper-multipath Loaded plugins: refresh-packagekit, rhnplugin This system is not registered with RHN. RHN support will be disabled. Installed Packages Name : device-mapper-multipath Arch : x86_64 Version : 0.4.9 Release : 31.el6 Size : 177 k Repo : installed From repo : rhel-latest Summary : Tools to manage multipath devices using device-mapper URL : http://christophe.varoqui.free.fr/ License : GPL+ Description: device-mapper-multipath provides tools to manage multipath devices by : instructing the device-mapper multipath kernel module what to do. : The tools are : : * multipath - Scan the system for multipath devices and assemble them. : * multipathd - Detects when paths fail and execs multipath to update things. [result] device-mapper-multipath is installed 2) See if /etc/multipath.conf exists. ~]# ls /etc/m mailcap makedev.d/ maven/ mime.types modprobe.d/ mtab multipath/ mail.rc man.config mdadm.conf mke2fs.conf motd mtools.conf my.cnf [result] /etc/multipath.conf does not exist. 3) Verify no tmp file in /etc/multipath/. ~]# ls -la /etc/multipath/ total 16 drwxr-xr-x. 2 root root 4096 Sep 8 00:21 . drwxr-xr-x. 114 root root 12288 Oct 15 09:28 .. [result] there is no tmp file in /etc/multipath/ 4) See if multipath.conf is in /usr/share/doc/device-mapper-multipath-0.4.9/. ~]# ls -la /usr/share/doc/device-mapper-multipath-0.4.9/ total 124 drwxr-xr-x. 2 root root 4096 Sep 8 11:14 . drwxr-xr-x. 778 root root 36864 Sep 3 09:42 .. -rw-r--r--. 1 root root 49 Oct 21 2009 AUTHOR -rw-r--r--. 1 root root 25284 Oct 21 2009 COPYING -rw-r--r--. 1 root root 3633 Oct 21 2009 FAQ -rw-r--r--. 1 root root 2597 Sep 8 00:21 multipath.conf -rw-r--r--. 1 root root 17236 Sep 8 00:21 multipath.conf.annotated -rw-r--r--. 1 root root 15524 Sep 8 00:21 multipath.conf.defaults -rw-r--r--. 1 root root 1652 Sep 8 00:21 multipath.conf.synthetic [result] /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf exists. According to mpathconf man page: "If /etc/multipath.conf already exists, mpathconf will edit it. If it does not exist, mpathconf will use /usr/share/doc/device-mapper-multipath-0.4.9/multi- path.conf as the starting file. This file has user_friendly_names set. If this file does not exist, mpathconf will create /etc/multipath.conf from scratch." 5) So rename /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf. ~]# mv /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.backup Verify. ~]# ls -la /usr/share/doc/device-mapper-multipath-0.4.9/ total 124 drwxr-xr-x. 2 root root 4096 Oct 15 10:16 . drwxr-xr-x. 778 root root 36864 Sep 3 09:42 .. -rw-r--r--. 1 root root 49 Oct 21 2009 AUTHOR -rw-r--r--. 1 root root 25284 Oct 21 2009 COPYING -rw-r--r--. 1 root root 3633 Oct 21 2009 FAQ -rw-r--r--. 1 root root 17236 Sep 8 00:21 multipath.conf.annotated -rw-r--r--. 1 root root 2597 Sep 8 00:21 multipath.conf.backup -rw-r--r--. 1 root root 15524 Sep 8 00:21 multipath.conf.defaults -rw-r--r--. 1 root root 1652 Sep 8 00:21 multipath.conf.synthetic 6) Run mpathconf --enable ~]# mpathconf --enable multipath is enabled find_multipaths is disabled user_friendly_names is disabled dm_multipath module is not loaded multipathd is chkconfiged off 7) See if /etc/multipath.conf exists. ~]# ls /etc/m mailcap makedev.d/ maven/ mime.types modprobe.d/ mtab multipath/ mail.rc man.config mdadm.conf mke2fs.conf motd mtools.conf my.cnf [result] /etc/multipath.conf does not exist. 8) See if tmp file in tmp file in /etc/multipath/ exists. ~]# ls -la /etc/multipath/ total 16 drwxr-xr-x. 2 root root 4096 Oct 15 10:18 . drwxr-xr-x. 114 root root 12288 Oct 15 09:28 .. -rw-------. 1 root root 0 Oct 15 10:18 .multipath.conf.tmp [result] there is now tmp file. 9) cat tmp file ~]# cat /etc/multipath/.multipath.conf.tmp ~]# [result] tmp file is empty. 10) Revert /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf. ~]# mv /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.backup /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf Verify. ~]# ls -la /usr/share/doc/device-mapper-multipath-0.4.9/ total 124 drwxr-xr-x. 2 root root 4096 Oct 15 10:27 . drwxr-xr-x. 778 root root 36864 Sep 3 09:42 .. -rw-r--r--. 1 root root 49 Oct 21 2009 AUTHOR -rw-r--r--. 1 root root 25284 Oct 21 2009 COPYING -rw-r--r--. 1 root root 3633 Oct 21 2009 FAQ -rw-r--r--. 1 root root 2597 Sep 8 00:21 multipath.conf -rw-r--r--. 1 root root 17236 Sep 8 00:21 multipath.conf.annotated -rw-r--r--. 1 root root 15524 Sep 8 00:21 multipath.conf.defaults -rw-r--r--. 1 root root 1652 Sep 8 00:21 multipath.conf.synthetic 11) Run mpathconf --enable again. ~]# mpathconf --enable multipath is enabled find_multipaths is disabled user_friendly_names is enabled dm_multipath module is not loaded multipathd is chkconfiged off 12) See if /etc/multipath.conf exists. ~]# ls /etc/m mailcap makedev.d/ maven/ mime.types modprobe.d/ mtab multipath/ mail.rc man.config mdadm.conf mke2fs.conf motd mtools.conf my.cnf [result] /etc/multipath.conf does not exist. 13) cat tmp file in /etc/multipath/ ~]# cat /etc/multipath/.multipath.conf.tmp # This is a basic configuration file with some examples, for device mapper # multipath. # For a complete list of the default configuration values, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults # For a list of configuration options with descriptions, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated ## By default, devices with vendor = "IBM" and product = "S/390.*" are ## blacklisted. To enable mulitpathing on these devies, uncomment the ## following lines. #blacklist_exceptions { # device { # vendor "IBM" # product "S/390.*" # } #} ## Use user friendly names, instead of using WWIDs as names. defaults { user_friendly_names yes } ## ## Here is an example of how to configure some standard options. ## # #defaults { # udev_dir /dev # polling_interval 10 # selector "round-robin 0" # path_grouping_policy multibus # getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n" # prio alua # path_checker readsector0 # rr_min_io 100 # max_fds 8192 # rr_weight priorities # failback immediate # no_path_retry fail # user_friendly_names yes #} ## ## The wwid line in the following blacklist section is shown as an example ## of how to blacklist devices by wwid. The 2 devnode lines are the ## compiled in default blacklist. If you want to blacklist entire types ## of devices, such as all scsi devices, you should use a devnode line. ## However, if you want to blacklist specific devices, you should use ## a wwid line. Since there is no guarantee that a specific device will ## not change names on reboot (from /dev/sda to /dev/sdb for example) ## devnode lines are not recommended for blacklisting specific devices. ## #blacklist { # wwid 26353900f02796769 # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" # devnode "^hd[a-z]" #} #multipaths { # multipath { # wwid 3600508b4000156d700012000000b0000 # alias yellow # path_grouping_policy multibus # path_checker readsector0 # path_selector "round-robin 0" # failback manual # rr_weight priorities # no_path_retry 5 # } # multipath { # wwid 1DEC_____321816758474 # alias red # } #} #devices { # device { # vendor "COMPAQ " # product "HSV110 (C)COMPAQ" # path_grouping_policy multibus # getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n" # path_checker readsector0 # path_selector "round-robin 0" # hardware_handler "0" # failback 15 # rr_weight priorities # no_path_retry queue # } # device { # vendor "COMPAQ " # product "MSA1000 " # path_grouping_policy multibus # } #} [result] tmp file now contains copy of /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf. 14) So let's manually copy /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf to /etc/multipath.conf. ~]# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf Verify. ~]# ls /etc/m mailcap man.config mime.types motd multipath/ mail.rc maven/ mke2fs.conf mtab multipath.conf makedev.d/ mdadm.conf modprobe.d/ mtools.conf my.cnf 15) Get current mpathconf config. ~]# mpathconf multipath is enabled find_multipaths is disabled user_friendly_names is enabled dm_multipath module is not loaded multipathd is chkconfiged off 16) Pass mpathconf option to change user_friendly_names to disabled. NOTE: man page says option is '--user_friendly_name' but command is '--user_friendly_names'. ~]# mpathconf --enable --user_friendly_names n multipath is enabled find_multipaths is disabled user_friendly_names is enabled dm_multipath module is not loaded multipathd is chkconfiged off [result] command did not work, user_friendly_names is still enabled. 17) Manually edit /etc/multipath.conf to change user_friendly_names to disabled. ~]# vim /etc/multipath.conf Verify. ~]# cat /etc/multipath.conf # This is a basic configuration file with some examples, for device mapper # multipath. # For a complete list of the default configuration values, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults # For a list of configuration options with descriptions, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated ## By default, devices with vendor = "IBM" and product = "S/390.*" are ## blacklisted. To enable mulitpathing on these devies, uncomment the ## following lines. #blacklist_exceptions { # device { # vendor "IBM" # product "S/390.*" # } #} ## Use user friendly names, instead of using WWIDs as names. defaults { user_friendly_names no } ## ## Here is an example of how to configure some standard options. ## # #defaults { # udev_dir /dev # polling_interval 10 # selector "round-robin 0" # path_grouping_policy multibus # getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n" # prio alua # path_checker readsector0 # rr_min_io 100 # max_fds 8192 # rr_weight priorities # failback immediate # no_path_retry fail # user_friendly_names yes #} ## ## The wwid line in the following blacklist section is shown as an example ## of how to blacklist devices by wwid. The 2 devnode lines are the ## compiled in default blacklist. If you want to blacklist entire types ## of devices, such as all scsi devices, you should use a devnode line. ## However, if you want to blacklist specific devices, you should use ## a wwid line. Since there is no guarantee that a specific device will ## not change names on reboot (from /dev/sda to /dev/sdb for example) ## devnode lines are not recommended for blacklisting specific devices. ## #blacklist { # wwid 26353900f02796769 # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" # devnode "^hd[a-z]" #} #multipaths { # multipath { # wwid 3600508b4000156d700012000000b0000 # alias yellow # path_grouping_policy multibus # path_checker readsector0 # path_selector "round-robin 0" # failback manual # rr_weight priorities # no_path_retry 5 # } # multipath { # wwid 1DEC_____321816758474 # alias red # } #} #devices { # device { # vendor "COMPAQ " # product "HSV110 (C)COMPAQ" # path_grouping_policy multibus # getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n" # path_checker readsector0 # path_selector "round-robin 0" # hardware_handler "0" # failback 15 # rr_weight priorities # no_path_retry queue # } # device { # vendor "COMPAQ " # product "MSA1000 " # path_grouping_policy multibus # } #} 18) Get current mpathconf config. ~]# mpathconf multipath is enabled find_multipaths is disabled user_friendly_names is disabled dm_multipath module is not loaded multipathd is chkconfiged off [result] user_friendly_names is disabled. 19) Try enable user_friendly_names via mpathconf cmd. ~]# mpathconf --enable --user_friendly_names y multipath is enabled find_multipaths is disabled user_friendly_names is disabled dm_multipath module is not loaded multipathd is chkconfiged off [result] command did not work, user_friendly_names is still disabled. Also noticed I can't disable multipath. ~]# mpathconf --disable multipath is enabled find_multipaths is disabled user_friendly_names is disabled dm_multipath module is not loaded multipathd is chkconfiged off Something is clearly wrong. You should only see that printout of state when no command has been selected. For some reason, mpathconf is ignoring your commands. I figured it out. If you don't enter any commands, the script sets a variable called DISPLAY. If you run # echo $DISPLAY you have the DISPLAY envrionment variable set, don't you. The script is checking the environment variable. I really need to change that name, and probably unset all the variable names I'm using at the start, just to be sure. The DISPLAY variable name has been changed, and all variables are unset at the start of the script. I did some testing, based on comment 8: kernel version for all tests is: 2.6.32-114.0.1.el6.x86_64 1. test device-mapper-multipath 0.4.9-37.el6, variable DISPLAY, isn't set 2. test device-mapper-multipath 0.4.9-31.el6, variable DISPLAY, isn't set 3. test device-mapper-multipath 0.4.9-30.el6, variable DISPLAY, set to value "klobas" 4. test device-mapper-multipath 0.4.9-38.el6, variable DISPLAY, set to value "klobas" results: in package version 0.4.9-38.el6 is stil error in user_friendly_name tests 1. 2. was ok, no problem test 3. the same behavior as in comment 8, in this version of package there is an error. test 4. everything ok, error was corrected. Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, if the user edited configuration information with the mpathconf command, the process could have failed. This happened when the user ran the command without any additional arguments due to a conflict of the environment variable DISPLAY with the program variable DISPLAY. With this update, all variables are unset when the script is started and the DISPLAY program variable is renamed. The environment variable DISPLAY remains unchanged when the mpathconf is issued and the command works as expected. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0725.html |