Hide Forgot
Description of problem: Opening at customer request. Is it possible to get a warning if the dm_multipath module is loaded, multipath devices are present, but multipathd is not set to on? Perhaps when using the 'multipath' command. The idea is that most users never use the multipathd command; they configure multipathing and use the multipath command. The multipathd service is an integral part of multipathing, so we should at least give an informative message if it is not running and the system is using multipath. Why do we not auto-start multipathd if the module is in use? Are there use cases where we would want to have multipath devices, but not use multipathd? I have seen many cases where proper failover/mapping was not acheived because multipathd was not running and no one knew. Could we request an auto load for multipathd instead of the warning? Maybe both? Thanks for your time. Please let me know if I can be of any help. Version-Release number of selected component (if applicable): device-mapper-multipath-0.4.9-87.el6.x86_64 Expected Results: - multipathd service autostart with module load - warning if service is not running when using multipath command
Loading the module can't autostart the service. There's no hook for anything like that in the module code. Besides, if there are no multipath devices, we don't want to start the service. If the service is enabled in systemd, it will autostart on boot, as long a /etc/multipath.conf exists. Creating the configuration file the recommended way, with # mpathconf --enable does enable the service in systemd. However, it does not autostart the service at that point. This is because users often want to actually edit the configuration file before starting the service the first time. The service will autostart on the next reboot. There are two ways to actually create multipath devices. Either multipathd will automatically create them, or they can be created manually by running multipath. I can make multipath print a warning message if multipathd isn't running. This should solve the case where there are multipath devices but multipathd isn't running. Does this sound reasonable?
Yes Ben that sounds perfect. Thanks a lot. John
Created attachment 1183368 [details] Proposed Patch v1 With the attached patch, dm-multipath commands e.g. multipath -v2, multipath -ll etc. now checks if there are multipath device maps created, and multipathd service is running or not? If the multipath device maps are created, but multipathd service is not running, then in such case there will be a warning message displayed to inform the user that IO failover/failback may not work as expected without multipathd process running.
Hello, The attached patch is for dm-multipath package in RHEL 7. There are significant differences in dm-multipath in RHEL 6 and 7 about how to verify if the multipathd process is running or not. So this patch would not be applicable for RHEL 6 dm-multipath package. I have cloned the RHEL 7 BZ#1359510 from current BZ, and have attached this patch in BZ#1359510. Sorry for the noise. Many thanks, Milan.
Thanks for the patch. Applied (in a slightly modified form).
Reproduced on device-mapper-multipath-0.4.9-72.el6 1. [root@storageqe-71 ~]# rpm -qa | grep multipath device-mapper-multipath-libs-0.4.9-72.el6.x86_64 device-mapper-multipath-0.4.9-72.el6.x86_64 2. [root@storageqe-71 ~]# mpathconf --enable 3. [root@storageqe-71 ~]# service multipathd restart ok Stopping multipathd daemon: [ OK ] Starting multipathd daemon: [ OK ] 4. [root@storageqe-71 ~]# service multipathd stop Stopping multipathd daemon: [ OK ] 5. [root@storageqe-71 ~]# multipath -ll mpathb (3600140515efaacbb9854dbf91428aa0d) dm-3 LIO-ORG,IBLOCK size=10G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 1:0:0:1 sdd 8:48 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 0:0:0:1 sdb 8:16 active ready running mpatha (36001405cca4c176848d4482853c9962c) dm-4 LIO-ORG,IBLOCK size=50G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 0:0:0:0 sda 8:0 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 1:0:0:0 sdc 8:32 active ready running <----------------List multipath devices while multipathd is stopped, multipath doesn't print a warning message Verified on device-mapper-multipath-0.4.9-100.el6 1. [root@storageqe-71 ~]# rpm -qa | grep multipath device-mapper-multipath-debuginfo-0.4.9-100.el6.x86_64 device-mapper-multipath-0.4.9-100.el6.x86_64 device-mapper-multipath-libs-0.4.9-100.el6.x86_64 2. [root@storageqe-71 ~]# mpathconf --enable 3. [root@storageqe-71 ~]# service multipathd restart ux_socket_connect: No such file or directory Stopping multipathd daemon: [FAILED] Starting multipathd daemon: [ OK ] 4. [root@storageqe-71 ~]# multipath -ll mpathb (3600140515efaacbb9854dbf91428aa0d) dm-3 LIO-ORG,IBLOCK size=10G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 0:0:0:1 sdb 8:16 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 1:0:0:1 sdc 8:32 active ready running mpatha (36001405cca4c176848d4482853c9962c) dm-4 LIO-ORG,IBLOCK size=50G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 0:0:0:0 sda 8:0 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 1:0:0:0 sdd 8:48 active ready running 5. [root@storageqe-71 ~]# service multipathd stop Stopping multipathd daemon: [ OK ] 6. [root@storageqe-71 ~]# multipath -ll mpathb (3600140515efaacbb9854dbf91428aa0d) dm-3 LIO-ORG,IBLOCK size=10G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 0:0:0:1 sdb 8:16 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 1:0:0:1 sdc 8:32 active ready running mpatha (36001405cca4c176848d4482853c9962c) dm-4 LIO-ORG,IBLOCK size=50G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 0:0:0:0 sda 8:0 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 1:0:0:0 sdd 8:48 active ready running multipath device maps are present, but 'multipathd' service is not running IO failover/failback will not work without 'multipathd' service running <----------------List multipath devices while multipathd is stopped, multipath prints a warning message now. Test result: list or create multipath devices while multipathd is stopped. Multipath should now print a warning message, where before it wouldn't
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2017-0697.html