How to disable one path in native multipathing (RHEL 6.4) ?
Does anybody know if it is possible to disable one path in native multipath config on RHEL 6.4 ?
Responses
Depends on what you mean by disable. In general, yes, you can disable a path, it just depends on what you're trying to achieve and where you'd like to do it. The easiest way is to do echo offline > /sys/block/${DEV}/device/state. For example, if you had a LUN under multipathd that looked like:
mpath0 (360a9800043346d364a4a2f41592d5849) dm-7 NETAPP,LUN
[size=20G][features=0][hwhandler=0][rw]
_ round-robin 0 [prio=0][active]
_ 0:0:0:1 sda 8:0 [active][undef]
_ 0:0:1:1 sdb 8:16 [active][undef]
_ 1:0:0:1 sdc 8:32 [active][undef]
_ 1:0:1:1 sdd 8:48 [active][undef]
and you did an echo offline /sys/block/sdb/device/state, multipath would produce an output similar to:
mpath0 (360a9800043346d364a4a2f41592d5849) dm-7 NETAPP,LUN
[size=20G][features=0][hwhandler=0][rw]
_ round-robin 0 [prio=0][active]
_ 0:0:0:1 sda 8:0 [active][undef]
_ 0:0:1:1 sdb 8:16 [failed][faulty]
_ 1:0:0:1 sdc 8:32 [active][undef]
_ 1:0:1:1 sdd 8:48 [active][undef]
If you could verify this state by writing I/O to the mpath node and verifying that nothing was actually being sent to the offline path/node.
Hello Przemyslaw Bak,
Could you explain what you are trying to do which might help us figure out the best way to go about the problem? (i.e. are you trying to single path the device because you are using some other type of multipath software? like VXdmp or PowerPath?) Or are you testing something?
Do you need a single path down (as in an entire fiber path), or selective to a single path on a device?
Perhaps I'm missing something with your description, but, if you're trying to disable I/O to an entire array, why are you presenting LUNs from that array to the system in question in the first place?
And, while you can use things like blacklist rules to disable multipathd from creating metadevices for a given path/LUN/ARRAY, it's not exactly the most efficient method for doing so (and doesn't prevent the host's SCSI drivers from creating devnodes that things other than multipathd might attempt to send traffic down).
Tom, I believe I follow/understand what Przemyslaw is trying to do. (I used to do the same thing in Solaris).
We had a single Hitachi Array that would occasionally need microcode updates. This would involve one half of the array front end ports being unavailable and after we recovered the HBAs on that side, we would proceed with the other side of the array. Our switch maintenance was the same way. We had an ODD and and EVEN side to our fabric. We would do maintenance on the ODD fabric (after disabling the ODD HBAs) and then once the maintenance was done, we would re-enable the ODD adapters and then proceed with the EVEN.
Technically, the multipath should handle the situation on it's own, but I think folks like having that extra confidence that the storage requests have been disabled proactively.
I'm trying to figure out how to accomplish your goal. I am actually surprised there is no simple way (that I can find) to simply "offline" or "disable" an HBA. Everything I find indicates that you should disable the block device (instead). Which seems like a TON of work.
In this example, I would first like to offline controller 1:
# multipath -ll -v2
ORION1_0802 dm-6 HITACHI,OPEN-V
[size=200G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=1][active]
\_ 1:0:1:2 sdf 8:80 [active][ready]
\_ 2:0:1:2 sdk 8:160 [active][ready]
# echo offline > /sys/block/sdf/device/state
I would script this with a for loop to offline everything that was 1:0:X
But... I would be way more comfortable to simply say "offline controller 1".
I'll keep looking as this is perplexing to me!
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
