Hi folks,<br><br>Based on the scenario i've described below I wrote a simple, totally based on pp_rdac.c, code to send a SCSI command WRITE_AND_VERITY (0x2E) and decide if that path is read-write or read-only.<br><br>The code is here: <a href="http://pastebin.com/m22b06f04">http://pastebin.com/m22b06f04</a><br>
<br>I'm sending it to the list to request for improve, tips, recommendations, anything... I'm not a developer anyway.<br><br>--<br><br>Flávio do Carmo Júnior aka waKKu <br><br><div class="gmail_quote">On Fri, Apr 24, 2009 at 11:21 PM, Flavio Junior <span dir="ltr"><<a href="mailto:billpp@gmail.com">billpp@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Fri, Apr 24, 2009 at 10:24 PM, Chandra Seetharaman<br>
<<a href="mailto:sekharan@us.ibm.com">sekharan@us.ibm.com</a>> wrote:<br>
> Hi Flavio,<br>
<br>
Hi Chandra ;)<br>
<div class="im"><br>
><br>
> Since you are using LSI's (I think it is not IBM's :) rdac driver, which<br>
> do provide multipathing functionality (as you see only one device per<br>
> lun) why do you want to use dm-multipath ?<br>
<br>
</div>I'm using dm-multipath to group LUN's at different storages. But, IBM<br>
DS4700 ERM just allows (really makes sense) read-write operations on<br>
the primary storage device, so this is why I need to different prio<br>
for paths.<br>
<div class="im"><br>
><br>
> >From your explanation it looks like you want to use mirroring on top of<br>
> the multipathed storage (but you are trying to use multipath) ?! correct<br>
> me if I am wrong.<br>
<br>
</div>Yes, exactly is. But the LSI RDAC driver is doing the one multipath<br>
channel (channel-A) for the the read-write LUN's (all r/w LUN's are in<br>
the same primary storage and have the same scsi_id) and another<br>
multipath channel (channel-B) for all read-only LUN's (all r/o LUN's<br>
are in the same *secundary* storage and have the same scsi_id).<br>
<br>
So, I've 2 devices that says to be the "same" by ERM, but one as<br>
primary=rw and another as secundary=ro, to reach primary i've<br>
channel-A and reach secundary i've channel-B.<br>
<br>
What I'm doing is: Grouping channel-A + channel-B into a single mpath<br>
device, and it is working as expected (i dont know if someone that<br>
really know about it would consider me a freak-crazy man, but it<br>
works).<br>
<div class="im"><br>
><br>
> Following are based on my understanding as explained above :)<br>
><br>
> BTW, dm-multipath will change the path group only when all the paths in<br>
> a path group fails. And, as soon as a path in the higher priority path<br>
> group comes back up (path checker returns success), dm-multipath will<br>
> start sending I/Os on that path.<br>
><br>
> Looks like changing the "secondary=read-only" to primary=read-write is<br>
> not getting reflected in your prio callout functionality.<br>
><br>
<br>
</div>Here you figure out my problem with annoying log messages :). So I'd<br>
understand i need to change prio when changing storage<br>
primary/secundary role. :)<br>
<div class="im"><br>
<br>
> Since your path checker (tur) returns success for the path with higher<br>
> priority, mutipathd daemon reinstates that path, and since the path<br>
> priority of that group is higher than the other one, it is made the<br>
> active one, and  i/os are sent on that path, which fails and that leads<br>
> to failing the path... but.... (goto the start of this paragraph :)<br>
><br>
</div>Ouch! ... I almost go into a infinity loop here ;).<br>
<br>
<br>
Well, you point my problem, now i'll think someway to calculate prio<br>
(inside that really restrict namespace) dynamically when changing the<br>
path.<br>
<br>
Really thanks, you make things a bit clear for me :).<br>
<br>
And if you (or anyone else) understand my scenario and knows it is not<br>
a good approach, please let me know before start production.<br>
<br>
Thanks all.<br>
<div><div></div><div class="h5"><br>
--<br>
<br>
Flávio do Carmo Júnior aka waKKu<br>
<br>
><br>
> On Fri, 2009-04-24 at 20:47 -0300, Flavio Junior wrote:<br>
>> Hi folks, good evening.<br>
>><br>
>> My idea is set dm-multipath to only change from a path if it fails.<br>
>> How can I do that?<br>
>><br>
>> Setup is something as:<br>
>><br>
>> - 2x DS4700 IBM Storages<br>
>> - 4x Fiber Switches (2 for each storage)<br>
>> - 4x Path to each LUN (2 controllers x 2 switches) - But it shows to<br>
>> me as a single device, because I'm using IBM rdac driver too.<br>
>><br>
>> Now, I've a primary storage as read-write AND a secundary mirrored<br>
>> (bit by bit synchronous) as read-only. Of course, the LUN id's at each<br>
>> storage are different so comes my first "hack" using getuid_callout to<br>
>> group paths, and prio_callout to set priority higher for primary<br>
>> storage and lower for secundary one.<br>
>><br>
>> Everything is working like a charm, configured as:<br>
>><br>
>> Link: <a href="http://pastebin.com/f4de2f7ca" target="_blank">http://pastebin.com/f4de2f7ca</a><br>
>><br>
>> # multipath.conf<br>
>> defaults {<br>
>>         user_friendly_names     yes<br>
>>         path_grouping_policy    failover<br>
>>         path_checker            tur<br>
>>         hardware_handler        "rdac"<br>
>> #       getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"<br>
>>         getuid_callout          "/etc/multipath/get_lun_path.sh %n"<br>
>> #       prio_callout            /bin/true<br>
>>         prio_callout            "/bin/bash<br>
>> /etc/multipath/get_lun_path.sh %n prio"<br>
>>         failback                8<br>
>> }<br>
>><br>
>> devices {<br>
>>         device {<br>
>>                 vendor       "dummy"<br>
>>                 product      "dummy"<br>
>>                 prio_callout "/sbin/scsi_id"<br>
>>         }<br>
>> }<br>
>><br>
>> [root@pinky ~]# cat /etc/multipath/get_lun_path.sh<br>
>> #!/bin/bash<br>
>><br>
>> DEVICE="$(/sbin/scsi_id -g -u -s /block/$1)"<br>
>> SCSI_ID_TABLE="/etc/multipath/scsi_id_multipath"<br>
>><br>
>> if [ $# -lt 1 ]; then<br>
>>         exit 1<br>
>> fi<br>
>><br>
>> if [ "$2" == "prio" ]; then<br>
>>         while read SCSI_ID WWID PRIO; do [ "$SCSI_ID" == "${DEVICE}" ]<br>
>> && echo $PRIO; done < $SCSI_ID_TABLE<br>
>>         exit 0<br>
>> else<br>
>>         while read SCSI_ID WWID PRIO; do [ "$SCSI_ID" == "${DEVICE}" ]<br>
>> && echo $WWID; done < $SCSI_ID_TABLE<br>
>>         exit 0<br>
>> fi<br>
>><br>
>> [root@pinky ~]# cat /etc/multipath/scsi_id_multipath<br>
>> 3600a0b800048834e0000150149dcc594       HomeMaildir1            2<br>
>> 3600a0b80004884c4000016e649dcc5a5       HomeMaildir2            2<br>
>> 3600a0b80004884c4000016e449dcc534       WebPages                2<br>
>> 3600a0b800048834e000014ff49dcc51b       MailQuorumDisk          2<br>
>> 3600a0b800048834e0000172c49e76cbb       FileSystemDLM           2<br>
>> 3600a0b80004885b40000b78f49dcd7f8       MailQuorumDisk          1<br>
>> 3600a0b80004885b40000b79149dcd817       HomeMaildir1            1<br>
>> 3600a0b80004885a00000c13349dcd9e5       HomeMaildir2            1<br>
>> 3600a0b80004885b40000baa149ec46b5       FileSystemDLM           1<br>
>> 3600a0b80004885a00000c13149dcd9c3       WebPages                1<br>
>><br>
>> [root@pinky ~]# multipath -ll<br>
>> fs_dlm0 (FileSystemDLM) dm-8 IBM,VirtualDisk<br>
>> [size=300M][features=0][hwhandler=0][rw]<br>
>> \_ round-robin 0 [prio=2][active]<br>
>>  \_ 3:0:0:4 sdf 8:80  [active][ready]<br>
>> \_ round-robin 0 [prio=1][enabled]<br>
>>  \_ 3:0:1:3 sdj 8:144 [active][ready]<br>
>> homemaildir1 (HomeMaildir2) dm-5 IBM,VirtualDisk<br>
>> [size=25G][features=0][hwhandler=0][rw]<br>
>> \_ round-robin 0 [prio=2][active]<br>
>>  \_ 3:0:0:1 sdc 8:32  [active][ready]<br>
>> \_ round-robin 0 [prio=1][enabled]<br>
>>  \_ 3:0:1:2 sdi 8:128 [active][ready]<br>
>> webpages0 (WebPages) dm-6 IBM,VirtualDisk<br>
>> [size=4.0G][features=0][hwhandler=0][rw]<br>
>> \_ round-robin 0 [prio=2][active]<br>
>>  \_ 3:0:0:2 sdd 8:48  [active][ready]<br>
>> \_ round-robin 0 [prio=1][enabled]<br>
>>  \_ 3:0:1:4 sdk 8:160 [active][ready]<br>
>> homemaildir0 (HomeMaildir1) dm-4 IBM,VirtualDisk<br>
>> [size=25G][features=0][hwhandler=0][rw]<br>
>> \_ round-robin 0 [prio=2][active]<br>
>>  \_ 3:0:0:0 sdb 8:16  [active][ready]<br>
>> \_ round-robin 0 [prio=1][enabled]<br>
>>  \_ 3:0:1:1 sdh 8:112 [active][ready]<br>
>> qdisk0 (MailQuorumDisk) dm-7 IBM,VirtualDisk<br>
>> [size=200M][features=0][hwhandler=0][rw]<br>
>> \_ round-robin 0 [prio=2][active]<br>
>>  \_ 3:0:0:3 sde 8:64  [active][ready]<br>
>> \_ round-robin 0 [prio=1][enabled]<br>
>>  \_ 3:0:1:0 sdg 8:96  [active][ready]<br>
>><br>
>> #####<br>
>><br>
>> The problem comes when my higher priority path goes down (it happens<br>
>> if I change secundary=read-only storage role to primary=read-write),<br>
>> so dm-multipath fail to secundary path but it keeps trying to change<br>
>> back for my "primary" path, and fill /var/log/messages with it (is at<br>
>> last of above post link):<br>
>><br>
>> Apr 24 20:26:52 cerebro multipathd: homemaildir0: switch to path group #2<br>
>> Apr 24 20:26:53 cerebro kernel: 91<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 Unrecognized SK - 7<br>
>> Apr 24 20:26:53 cerebro kernel: 492<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 IO FAILURE. vcmnd SN 20095 pdev<br>
>> H1:C0:T1:L0 0x07/0x27/0x00 0x08000002 mpp_status:1<br>
>> Apr 24 20:26:53 cerebro kernel: sd 3:0:1:0: SCSI error: return code = 0x08000002<br>
>> Apr 24 20:26:53 cerebro kernel: sdg: Current: sense key: Data Protect<br>
>> Apr 24 20:26:53 cerebro kernel:     Add. Sense: Write protected<br>
>> Apr 24 20:26:53 cerebro kernel:<br>
>> Apr 24 20:26:53 cerebro kernel: end_request: I/O error, dev sdg, sector 1289<br>
>> Apr 24 20:26:53 cerebro kernel: device-mapper: multipath: Failing path 8:96.<br>
>> Apr 24 20:26:53 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:26:53 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:26:58 cerebro multipathd: 8:96: mark as failed<br>
>> Apr 24 20:26:58 cerebro multipathd: homemaildir0: remaining active paths: 1<br>
>> Apr 24 20:26:58 cerebro multipathd: sdg: tur checker reports path is up<br>
>> Apr 24 20:26:58 cerebro multipathd: 8:96: reinstated<br>
>> Apr 24 20:26:58 cerebro multipathd: homemaildir0: remaining active paths: 2<br>
>> Apr 24 20:26:58 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:26:58 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:06 cerebro multipathd: homemaildir0: switch to path group #2<br>
>> Apr 24 20:27:07 cerebro kernel: 91<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 Unrecognized SK - 7<br>
>> Apr 24 20:27:07 cerebro kernel: 492<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 IO FAILURE. vcmnd SN 20212 pdev<br>
>> H1:C0:T1:L0 0x07/0x27/0x00 0x08000002 mpp_status:1<br>
>> Apr 24 20:27:07 cerebro kernel: sd 3:0:1:0: SCSI error: return code = 0x08000002<br>
>> Apr 24 20:27:07 cerebro kernel: sdg: Current: sense key: Data Protect<br>
>> Apr 24 20:27:07 cerebro kernel:     Add. Sense: Write protected<br>
>> Apr 24 20:27:07 cerebro kernel:<br>
>> Apr 24 20:27:07 cerebro kernel: end_request: I/O error, dev sdg, sector 1289<br>
>> Apr 24 20:27:07 cerebro kernel: device-mapper: multipath: Failing path 8:96.<br>
>> Apr 24 20:27:07 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:07 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:07 cerebro multipathd: 8:96: mark as failed<br>
>> Apr 24 20:27:07 cerebro multipathd: homemaildir0: remaining active paths: 1<br>
>> Apr 24 20:27:12 cerebro multipathd: sdg: tur checker reports path is up<br>
>> Apr 24 20:27:12 cerebro multipathd: 8:96: reinstated<br>
>> Apr 24 20:27:12 cerebro multipathd: homemaildir0: remaining active paths: 2<br>
>> Apr 24 20:27:12 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:12 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:20 cerebro multipathd: homemaildir0: switch to path group #2<br>
>> Apr 24 20:27:21 cerebro kernel: 91<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 Unrecognized SK - 7<br>
>> Apr 24 20:27:21 cerebro kernel: 492<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 IO FAILURE. vcmnd SN 20305 pdev<br>
>> H1:C0:T1:L0 0x07/0x27/0x00 0x08000002 mpp_status:1<br>
>> Apr 24 20:27:21 cerebro kernel: sd 3:0:1:0: SCSI error: return code = 0x08000002<br>
>> Apr 24 20:27:21 cerebro kernel: sdg: Current: sense key: Data Protect<br>
>> Apr 24 20:27:21 cerebro kernel:     Add. Sense: Write protected<br>
>> Apr 24 20:27:21 cerebro kernel:<br>
>> Apr 24 20:27:21 cerebro kernel: end_request: I/O error, dev sdg, sector 1289<br>
>> Apr 24 20:27:21 cerebro kernel: device-mapper: multipath: Failing path 8:96.<br>
>> Apr 24 20:27:21 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:21 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:21 cerebro multipathd: 8:96: mark as failed<br>
>> Apr 24 20:27:21 cerebro multipathd: homemaildir0: remaining active paths: 1<br>
>> Apr 24 20:27:26 cerebro multipathd: sdg: tur checker reports path is up<br>
>> Apr 24 20:27:26 cerebro multipathd: 8:96: reinstated<br>
>> Apr 24 20:27:26 cerebro multipathd: homemaildir0: remaining active paths: 2<br>
>> Apr 24 20:27:26 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:26 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:34 cerebro multipathd: homemaildir0: switch to path group #2<br>
>> Apr 24 20:27:35 cerebro kernel: 91<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 Unrecognized SK - 7<br>
>> Apr 24 20:27:35 cerebro kernel: 492<br>
>> [RAIDarray.mpp]IBM_DS4700_SITE1:1:0:0 IO FAILURE. vcmnd SN 20419 pdev<br>
>> H1:C0:T1:L0 0x07/0x27/0x00 0x08000002 mpp_status:1<br>
>> Apr 24 20:27:35 cerebro kernel: sd 3:0:1:0: SCSI error: return code = 0x08000002<br>
>> Apr 24 20:27:35 cerebro kernel: sdg: Current: sense key: Data Protect<br>
>> Apr 24 20:27:35 cerebro kernel:     Add. Sense: Write protected<br>
>> Apr 24 20:27:35 cerebro kernel:<br>
>> Apr 24 20:27:35 cerebro kernel: end_request: I/O error, dev sdg, sector 1289<br>
>> Apr 24 20:27:35 cerebro kernel: device-mapper: multipath: Failing path 8:96.<br>
>> Apr 24 20:27:35 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:35 cerebro multipathd: dm-5: devmap already registered<br>
>> Apr 24 20:27:35 cerebro multipathd: 8:96: mark as failed<br>
>> Apr 24 20:27:35 cerebro multipathd: homemaildir0: remaining active paths: 1<br>
>> Apr 24 20:27:40 cerebro multipathd: sdg: tur checker reports path is up<br>
>> Apr 24 20:27:40 cerebro multipathd: 8:96: reinstated<br>
>> Apr 24 20:27:40 cerebro multipathd: homemaildir0: remaining active paths: 2<br>
>> Apr 24 20:27:40 cerebro multipathd: dm-5: add map (uevent)<br>
>> Apr 24 20:27:40 cerebro multipathd: dm-5: devmap already registered<br>
>> #############<br>
>><br>
>><br>
>> My idea is set dm-multipath to only change from a path if it fails.<br>
>> How can I do that?<br>
>><br>
>> Any comments, doubts or suggest for this config would be appreciated<br>
>> as i'm new to all this hardware/setup.<br>
>><br>
>> Thanks in advance.<br>
>><br>
>> --<br>
>><br>
>> Flávio do Carmo Júnior aka waKKu<br>
>><br>
>> --<br>
>> dm-devel mailing list<br>
>> <a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
>> <a href="https://www.redhat.com/mailman/listinfo/dm-devel" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
><br>
> --<br>
> dm-devel mailing list<br>
> <a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/dm-devel" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
><br>
</div></div></blockquote></div><br>