<font size=2 face="DejaVu Sans Mono">Hello List,</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">I'm currently facing a problem
with a storage virtualization device which is located in two different
datacenters and shows up as another path to a configured SAN-LUN.</font>
<br><font size=2 face="DejaVu Sans Mono">The virtualization device is from
EMC˛ and is called V-PLEX.</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">So I have something like this:</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"> DC
A</font>
<br><font size=2 face="DejaVu Sans Mono">Host ---VPLEX-DC A---LUN storage
A</font>
<br><font size=2 face="DejaVu Sans Mono"> |
|</font>
<br><font size=2 face="DejaVu Sans Mono">..|...........|...................</font>
<br><font size=2 face="DejaVu Sans Mono"> | DC B |</font>
<br><font size=2 face="DejaVu Sans Mono"> ------VPLEX-DC B---LUN
storage B</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">The VPLEX device itself is for
storage based mirroring and synchronizes write access to storage A to storage
B and the other way around.</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">My problem is, that the virtual
LUN I get from the VPLEX does not have any prioritization given by dm-multipath
and looks like this:</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">mpath3 (36000144000000010e06d8f12ec30dfef)
dm-9 EMC,Invista</font>
<br><font size=2 face="DejaVu Sans Mono">[size=5.0G][features=1 queue_if_no_path][hwhandler=0][rw]</font>
<br><font size=2 face="DejaVu Sans Mono">\_ round-robin 0 [prio=1][active]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 5:0:1:2 sdad 65:208 [active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 5:0:4:2 sdak 66:64 [active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 5:0:5:2 sdap 66:144 [active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 4:0:0:2 sdc 8:32
[active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 4:0:1:2 sdh 8:112
[active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 4:0:4:2 sdo 8:224
[active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 4:0:5:2 sdt 65:48
[active][ready]</font>
<br><font size=2 face="DejaVu Sans Mono"> \_ 5:0:0:2 sdy 65:128
[active][ready]</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">That way, write access is made
round-robin and access to the "remote-devices" - device located
in the other DC - creating duplicate traffic through the</font>
<br><font size=2 face="DejaVu Sans Mono">SAN switches as the access has
to be routed to the remote VPLEX-B and it will write to the local VPLEX-A.</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">I wanted to solve this problem
by giving priorities to a path by its remote-port - which is different
for each connection to a SAN device. Unfortunately</font>
<br><font size=2 face="DejaVu Sans Mono">there currently doesn't exist
any priorizer and I have to write one on my own.</font>
<br><font size=2 face="DejaVu Sans Mono">To make the definition flexible,
I would like to have a file with a list of port-wwns associated with a
priority.</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">For versions shipped with RHEL5
this could be a simple shell script which simply looks up the sysfs file
structures of a given device. For RHEL6 this has to be</font>
<br><font size=2 face="DejaVu Sans Mono">a binary library. So writing a
binary version will make more sense than maintaining two different solutions.</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">A P-o-c script I wrote runs fine
on RHEL5 - althouh a bit slow - but shows the results I wanted to see:</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">--------- script --------</font>
<br><font size=2 face="DejaVu Sans Mono">#! /bin/bash</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">PRIO_DEF="/etc/dm-multipath-vplex.conf"</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">DEVICE=${1#/dev/*}</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"># find scsi-device address</font>
<br><font size=2 face="DejaVu Sans Mono">SCSI_ADDR="$(basename $(readlink
/sys/block/$DEVICE/device/scsi_device*) )"</font>
<br><font size=2 face="DejaVu Sans Mono"># 3:0:2:0</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"># remove trailing :0</font>
<br><font size=2 face="DejaVu Sans Mono">SCSI_ADDR=${SCSI_ADDR%:*}</font>
<br><font size=2 face="DejaVu Sans Mono"># 3:0:2</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"># change x:x:x to x:x-x</font>
<br><font size=2 face="DejaVu Sans Mono">SCSI_ADDR=$(echo "$SCSI_ADDR"
| sed -e 's/:\([0-9]\)$/-\1/' )</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"># get port_name for scsi-remote-port</font>
<br><font size=2 face="DejaVu Sans Mono">RPORT=$(cat "/sys/class/fc_remote_ports/rport-$SCSI_ADDR/port_name")</font>
<br>
<br><font size=2 face="DejaVu Sans Mono"># return prio</font>
<br><font size=2 face="DejaVu Sans Mono">IGNORECASE=1</font>
<br><font size=2 face="DejaVu Sans Mono">awk "/$RPORT/ { print \$1
}" $PRIO_DEF</font>
<br><font size=2 face="DejaVu Sans Mono">------------------------------------------</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">---------- dm-multipath-vplex.conf
--------</font>
<br><font size=2 face="DejaVu Sans Mono"># VPLEX DC A</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442606d8f00</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442606d8f01</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442606d8f02</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442606d8f03</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442706d8f00</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442706d8f01</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442706d8f02</font>
<br><font size=2 face="DejaVu Sans Mono">1 0x50001442706d8f03</font>
<br><font size=2 face="DejaVu Sans Mono"># VPLEX DC B</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144260641900</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144260641901</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144260641902</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144260641903</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144270641900</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144270641901</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144270641902</font>
<br><font size=2 face="DejaVu Sans Mono">2 0x5000144270641903</font>
<br><font size=2 face="DejaVu Sans Mono">--------------------------------------------</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">Do you think that this solutions
is worth including it as rport-prio into device mappers source? My C language
skills are a bit rusty, but I at least managed to</font>
<br><font size=2 face="DejaVu Sans Mono">find out the SCSI-address of a
given device and build the sysfs-path to the remote port.</font>
<br><font size=2 face="DejaVu Sans Mono">The rest should also be manageable,
but I wanted to ask as early a possible to have it included into mainstream
and get some feedback on this.</font>
<br>
<br>
<br><font size=2 face="DejaVu Sans Mono">Best regrads,</font>
<br>
<br><font size=2 face="DejaVu Sans Mono">Andreas Bleischwitz</font>
<br>
<br>