All of lore.kernel.org
 help / color / mirror / Atom feed
* Priozier for remote port on fibre channel devices
@ 2013-01-11  7:11 Andreas.Bleischwitz
  2013-01-11  7:22 ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas.Bleischwitz @ 2013-01-11  7:11 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 3751 bytes --]

Hello List,

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.
The virtualization device is from EMC² and is called V-PLEX.

So I have something like this:

        DC A
Host ---VPLEX-DC A---LUN storage A
  |           |
..|...........|...................
  |     DC B  |
  ------VPLEX-DC B---LUN storage B

The VPLEX device itself is for storage based mirroring and synchronizes 
write access to storage A to storage B and the other way around.

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:

mpath3 (36000144000000010e06d8f12ec30dfef) dm-9 EMC,Invista
[size=5.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=1][active]
 \_ 5:0:1:2 sdad 65:208 [active][ready]
 \_ 5:0:4:2 sdak 66:64  [active][ready]
 \_ 5:0:5:2 sdap 66:144 [active][ready]
 \_ 4:0:0:2 sdc  8:32   [active][ready]
 \_ 4:0:1:2 sdh  8:112  [active][ready]
 \_ 4:0:4:2 sdo  8:224  [active][ready]
 \_ 4:0:5:2 sdt  65:48  [active][ready]
 \_ 5:0:0:2 sdy  65:128 [active][ready]

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
SAN switches as the access has to be routed to the remote VPLEX-B and it 
will write to the local VPLEX-A.

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
there currently doesn't exist any priorizer and I have to write one on my 
own.
To make the definition flexible, I would like to have a file with a list 
of port-wwns associated with a priority.

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
a binary library. So writing a binary version will make more sense than 
maintaining two different solutions.

A P-o-c script I wrote runs fine on RHEL5 - althouh a bit slow - but shows 
the results I wanted to see:

--------- script --------
#! /bin/bash

PRIO_DEF="/etc/dm-multipath-vplex.conf"

DEVICE=${1#/dev/*}

# find scsi-device address
SCSI_ADDR="$(basename $(readlink /sys/block/$DEVICE/device/scsi_device*) 
)"
# 3:0:2:0

# remove trailing :0
SCSI_ADDR=${SCSI_ADDR%:*}
# 3:0:2

# change x:x:x to x:x-x
SCSI_ADDR=$(echo "$SCSI_ADDR" | sed -e 's/:\([0-9]\)$/-\1/' )

# get port_name for scsi-remote-port
RPORT=$(cat "/sys/class/fc_remote_ports/rport-$SCSI_ADDR/port_name")

# return prio
IGNORECASE=1
awk "/$RPORT/ { print \$1 }"  $PRIO_DEF
------------------------------------------

---------- dm-multipath-vplex.conf --------
# VPLEX DC A
1 0x50001442606d8f00
1 0x50001442606d8f01
1 0x50001442606d8f02
1 0x50001442606d8f03
1 0x50001442706d8f00
1 0x50001442706d8f01
1 0x50001442706d8f02
1 0x50001442706d8f03
# VPLEX DC B
2 0x5000144260641900
2 0x5000144260641901
2 0x5000144260641902
2 0x5000144260641903
2 0x5000144270641900
2 0x5000144270641901
2 0x5000144270641902
2 0x5000144270641903
--------------------------------------------

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
find out the SCSI-address of a given device and build the sysfs-path to 
the remote port.
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.


Best regrads,

Andreas Bleischwitz


[-- Attachment #1.2: Type: text/html, Size: 7625 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Priozier for remote port on fibre channel devices
  2013-01-11  7:11 Priozier for remote port on fibre channel devices Andreas.Bleischwitz
@ 2013-01-11  7:22 ` Hannes Reinecke
  2013-01-11  7:47   ` Andreas.Bleischwitz
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2013-01-11  7:22 UTC (permalink / raw)
  To: dm-devel

On 01/11/2013 08:11 AM, 
Andreas.Bleischwitz@continental-corporation.com wrote:
> Hello List,
>
> 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.
> The virtualization device is from EMC² and is called V-PLEX.
>
> So I have something like this:
>
>          DC A
> Host ---VPLEX-DC A---LUN storage A
>    |     |
> ..|...........|...................
>    |     DC B  |
>    ------VPLEX-DC B---LUN storage B
>
> The VPLEX device itself is for storage based mirroring and
> synchronizes write access to storage A to storage B and the other
> way around.
>
> 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:
>
> mpath3 (36000144000000010e06d8f12ec30dfef) dm-9 EMC,Invista
> [size=5.0G][features=1 queue_if_no_path][hwhandler=0][rw]
> \_ round-robin 0 [prio=1][active]
>   \_ 5:0:1:2 sdad 65:208 [active][ready]
>   \_ 5:0:4:2 sdak 66:64  [active][ready]
>   \_ 5:0:5:2 sdap 66:144 [active][ready]
>   \_ 4:0:0:2 sdc  8:32   [active][ready]
>   \_ 4:0:1:2 sdh  8:112  [active][ready]
>   \_ 4:0:4:2 sdo  8:224  [active][ready]
>   \_ 4:0:5:2 sdt  65:48  [active][ready]
>   \_ 5:0:0:2 sdy  65:128 [active][ready]
>
> 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
> SAN switches as the access has to be routed to the remote VPLEX-B
> and it will write to the local VPLEX-A.
>
> 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
> there currently doesn't exist any priorizer and I have to write one
> on my own.
> To make the definition flexible, I would like to have a file with a
> list of port-wwns associated with a priority.
>
> 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
> a binary library. So writing a binary version will make more sense
> than maintaining two different solutions.
>

Well, at least on SLES we're shipping a prioritizer named 
'weightedpath' which does exactly this.

However, chances are that the VPLEX is supporting ALUA, so you might 
want to use the 'alua' prioritizer here.

What is the output of 'sg_inq /dev/sdc' ?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Priozier for remote port on fibre channel devices
  2013-01-11  7:22 ` Hannes Reinecke
@ 2013-01-11  7:47   ` Andreas.Bleischwitz
  2013-01-11  8:06     ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas.Bleischwitz @ 2013-01-11  7:47 UTC (permalink / raw)
  Cc: dm-devel, dm-devel-bounces


[-- Attachment #1.1: Type: text/plain, Size: 4203 bytes --]

Hello Hannes,

sorry for top-posting, but crappy Notes is not really a good client for 
mailing-list - at least I don't know how to avoid such mess.

The output is 

[root@fru3710e ~]# sg_inq /dev/sdc
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x04  [SPC-2]
  [AERC=0]  [TrmTsk=0]  NormACA=1  HiSUP=1  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  BQue=0
  EncServ=0  MultiP=1 (VS=1)  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
    length=193 (0xc1)   Peripheral device type: disk
 Vendor identification: EMC 
 Product identification: Invista 
 Product revision level: 5100
 Unit serial number: CKM00xxxxxxxxx 

and well, 'weightedpath' is also available in RHEL, but only queries for 
the device name and the SCSI-address. I wanted to query the remote-port of 
the storage-device - which is the frontend wwn of the storage device.

Cheers,

Andreas





From:   Hannes Reinecke <hare@suse.de>
To:     dm-devel@redhat.com, 
Date:   11.01.2013 08:28
Subject:        Re: [dm-devel] Priozier for remote port on fibre channel 
devices
Sent by:        dm-devel-bounces@redhat.com



On 01/11/2013 08:11 AM, 
Andreas.Bleischwitz@continental-corporation.com wrote:
> Hello List,
>
> 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.
> The virtualization device is from EMC² and is called V-PLEX.
>
> So I have something like this:
>
>          DC A
> Host ---VPLEX-DC A---LUN storage A
>    |     |
> ..|...........|...................
>    |     DC B  |
>    ------VPLEX-DC B---LUN storage B
>
> The VPLEX device itself is for storage based mirroring and
> synchronizes write access to storage A to storage B and the other
> way around.
>
> 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:
>
> mpath3 (36000144000000010e06d8f12ec30dfef) dm-9 EMC,Invista
> [size=5.0G][features=1 queue_if_no_path][hwhandler=0][rw]
> \_ round-robin 0 [prio=1][active]
>   \_ 5:0:1:2 sdad 65:208 [active][ready]
>   \_ 5:0:4:2 sdak 66:64  [active][ready]
>   \_ 5:0:5:2 sdap 66:144 [active][ready]
>   \_ 4:0:0:2 sdc  8:32   [active][ready]
>   \_ 4:0:1:2 sdh  8:112  [active][ready]
>   \_ 4:0:4:2 sdo  8:224  [active][ready]
>   \_ 4:0:5:2 sdt  65:48  [active][ready]
>   \_ 5:0:0:2 sdy  65:128 [active][ready]
>
> 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
> SAN switches as the access has to be routed to the remote VPLEX-B
> and it will write to the local VPLEX-A.
>
> 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
> there currently doesn't exist any priorizer and I have to write one
> on my own.
> To make the definition flexible, I would like to have a file with a
> list of port-wwns associated with a priority.
>
> 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
> a binary library. So writing a binary version will make more sense
> than maintaining two different solutions.
>

Well, at least on SLES we're shipping a prioritizer named 
'weightedpath' which does exactly this.

However, chances are that the VPLEX is supporting ALUA, so you might 
want to use the 'alua' prioritizer here.

What is the output of 'sg_inq /dev/sdc' ?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                                    zSeries & Storage
hare@suse.de                                                   +49 911 
74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[-- Attachment #1.2: Type: text/html, Size: 6974 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Priozier for remote port on fibre channel devices
  2013-01-11  7:47   ` Andreas.Bleischwitz
@ 2013-01-11  8:06     ` Hannes Reinecke
  2013-01-11  8:18       ` Andreas.Bleischwitz
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2013-01-11  8:06 UTC (permalink / raw)
  To: dm-devel

On 01/11/2013 08:47 AM, 
Andreas.Bleischwitz@continental-corporation.com wrote:
> Hello Hannes,
>
> sorry for top-posting, but crappy Notes is not really a good client
> for mailing-list - at least I don't know how to avoid such mess.
>
> The output is
>
> [root@fru3710e ~]# sg_inq /dev/sdc
> standard INQUIRY:
>    PQual=0  Device_type=0  RMB=0  version=0x04  [SPC-2]
>    [AERC=0]  [TrmTsk=0]  NormACA=1  HiSUP=1  Resp_data_format=2
>    SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  BQue=0
>    EncServ=0  MultiP=1 (VS=1)  [MChngr=0]  [ACKREQQ=0]  Addr16=0
>    [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
>    [SPI: Clocking=0x0  QAS=0  IUS=0]
>      length=193 (0xc1) Peripheral device type: disk
>   Vendor identification: EMC
>   Product identification: Invista
>   Product revision level: 5100
>   Unit serial number: CKM00xxxxxxxxx
>
Hehe. No alua for you (TPGS=0).
But that's EMC for you; probably you should count yourself lucky
that it's not claiming compability to SCSI-2 ...

> and well, 'weightedpath' is also available in RHEL, but only queries
> for the device name and the SCSI-address. I wanted to query the
> remote-port of the storage-device - which is the frontend wwn of the
> storage device.
>
Why don't you use the 'by-path' symlinks for the device name in 
weightedpath?
They'll include the target port WWN, so should give you what you want.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Priozier for remote port on fibre channel devices
  2013-01-11  8:06     ` Hannes Reinecke
@ 2013-01-11  8:18       ` Andreas.Bleischwitz
  2013-01-11  8:42         ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas.Bleischwitz @ 2013-01-11  8:18 UTC (permalink / raw)
  To: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 2405 bytes --]

Thanks for the hint, that will at least work for RHEL6+. For RHEL5 I will 
use the scripted version.

The only downside on that is, that I will have a long line for the 
weightedpath regex definition as this has to be for each VPLEX-port.
At least I will have reduced the need to write something on my own ;)

Best regards,

Andreas



From:   Hannes Reinecke <hare@suse.de>
To:     dm-devel@redhat.com, 
Date:   11.01.2013 09:08
Subject:        Re: [dm-devel] Priozier for remote port on fibre channel 
devices
Sent by:        dm-devel-bounces@redhat.com



On 01/11/2013 08:47 AM, 
Andreas.Bleischwitz@continental-corporation.com wrote:
> Hello Hannes,
>
> sorry for top-posting, but crappy Notes is not really a good client
> for mailing-list - at least I don't know how to avoid such mess.
>
> The output is
>
> [root@fru3710e ~]# sg_inq /dev/sdc
> standard INQUIRY:
>    PQual=0  Device_type=0  RMB=0  version=0x04  [SPC-2]
>    [AERC=0]  [TrmTsk=0]  NormACA=1  HiSUP=1  Resp_data_format=2
>    SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  BQue=0
>    EncServ=0  MultiP=1 (VS=1)  [MChngr=0]  [ACKREQQ=0]  Addr16=0
>    [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
>    [SPI: Clocking=0x0  QAS=0  IUS=0]
>      length=193 (0xc1) Peripheral device type: disk
>   Vendor identification: EMC
>   Product identification: Invista
>   Product revision level: 5100
>   Unit serial number: CKM00xxxxxxxxx
>
Hehe. No alua for you (TPGS=0).
But that's EMC for you; probably you should count yourself lucky
that it's not claiming compability to SCSI-2 ...

> and well, 'weightedpath' is also available in RHEL, but only queries
> for the device name and the SCSI-address. I wanted to query the
> remote-port of the storage-device - which is the frontend wwn of the
> storage device.
>
Why don't you use the 'by-path' symlinks for the device name in 
weightedpath?
They'll include the target port WWN, so should give you what you want.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                                    zSeries & Storage
hare@suse.de                                                   +49 911 
74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[-- Attachment #1.2: Type: text/html, Size: 4164 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Priozier for remote port on fibre channel devices
  2013-01-11  8:18       ` Andreas.Bleischwitz
@ 2013-01-11  8:42         ` Hannes Reinecke
  0 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2013-01-11  8:42 UTC (permalink / raw)
  To: device-mapper development

On 01/11/2013 09:18 AM, 
Andreas.Bleischwitz@continental-corporation.com wrote:
> Thanks for the hint, that will at least work for RHEL6+. For RHEL5 I
> will use the scripted version.
>
> The only downside on that is, that I will have a long line for the
> weightedpath regex definition as this has to be for each VPLEX-port.
> At least I will have reduced the need to write something on my own ;)
>
Or write you own udev rules to generate shorter names ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-11  8:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11  7:11 Priozier for remote port on fibre channel devices Andreas.Bleischwitz
2013-01-11  7:22 ` Hannes Reinecke
2013-01-11  7:47   ` Andreas.Bleischwitz
2013-01-11  8:06     ` Hannes Reinecke
2013-01-11  8:18       ` Andreas.Bleischwitz
2013-01-11  8:42         ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.