* WWN on FC LUN targets
@ 2004-07-27 20:55 Rock Gordon
2004-07-28 0:54 ` Bryan Henderson
0 siblings, 1 reply; 7+ messages in thread
From: Rock Gordon @ 2004-07-27 20:55 UTC (permalink / raw)
To: linux-scsi
Hi,
I am looking at ways to find out particular WWN (world
wide names) for SCSI target LUNs connected to HBAs or
FC switches through either of the four modes available
(P2P, Fabric, AL and Fabric-AL)
Also, is there a programming interface to do this
across all available hardware? If that's not possible,
then other solutions are most welcome.
I want to be able to convert particular WWNs into
local major/minor number combination for my datacenter
SAN so that I can mount particular LUNs from any
server without worrying about changes in the device
naming conventions.
PS: can devfs solve this problem across a deployment
of 128-port FC switche connected to about 50 storage
LUNs (all FC-capable P2P linked RAID5 storage units)?
(please note that hotplug and unplug activity goes on
happening over the remaining nodes)
PS1: Please CC me since I'm not on the list (I wonder
why :) )
Thanks and regards,
Rocky
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: WWN on FC LUN targets
2004-07-27 20:55 WWN on FC LUN targets Rock Gordon
@ 2004-07-28 0:54 ` Bryan Henderson
2004-08-01 9:05 ` Douglas Gilbert
0 siblings, 1 reply; 7+ messages in thread
From: Bryan Henderson @ 2004-07-28 0:54 UTC (permalink / raw)
To: Rock Gordon; +Cc: linux-scsi
>I am looking at ways to find out particular WWN (world
>wide names) for SCSI target LUNs
LUNS don't actually have fibre channel WWNs. And neither do SCSI logical
units, which is probably what you meant (a LUN is a logical unit number).
WWNs come in two flavors - World Wide Node Name (WWNN), which identifies a
SCSI target, and World Wide Port Name (WWPN), which identifies a port on a
target. Neither of those is what you want, since you probably have
multiple logical units per target.
If you're like most FC users, your LUNs aren't stable even within a
target, so you can't use a combination of WWNN and LUN either.
So what people use is either SCSI device serial number or SCSI device ID.
The latter is newer and better. There are device IDs for targets, ports,
and logical units. There are device IDs in each of various name spaces,
some defined by public standards. You can read all about that in SCSI
specifications. Device IDs are part of the Vital Product Data (VPD).
The basic programming interface to get that information is the SCSI
INQUIRY command.
People have written programs to do the INQUIRY and give you the results in
usable form and even create the device special files named after the
device IDs. I'm afraid I can't name one at the moment, but I hope someone
else on the list chimes in with the specifics.
You could do this with devfs, but you'd be happier doing it with a user
space program that just queries the devices at all the relevant
major/minor number combinations and creates the /dev files you want. And
the same for responding to hotplug events. In Linux 2.6, that process is
even formalized in 'udev'.
This is, by the way, something people have been doing for years. It's
only starting to become standard so that everyone doesn't have to write
his own.
>I can mount particular [logical units] from any
>server without worrying about changes in the device
>naming conventions.
Of course, naming conventions are the least of your problems. When you
try to use the /dev/sda etc. names, they will change every time the
slightest thing in your system changes -- recabling, adding adapter cards,
changing adapter card brand, creating new LUs, and on and on. And they
will be different on every system.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: WWN on FC LUN targets
@ 2004-07-28 14:22 David Peterson (Eng)
2004-07-28 15:46 ` Rock Gordon
0 siblings, 1 reply; 7+ messages in thread
From: David Peterson (Eng) @ 2004-07-28 14:22 UTC (permalink / raw)
To: Bryan Henderson, Rock Gordon; +Cc: linux-scsi
If supported by the device, use the Device Identification VPD page
(0x83) to identify the Logical Unit. See SPC-3.
The preferred identifier type is NAA (which is a Worldwide_Name). Annex
D in FCP-2/FCP-3 may also be of assistance to you.
...Dave
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Bryan Henderson
Sent: Tuesday, July 27, 2004 7:54 PM
To: Rock Gordon
Cc: linux-scsi@vger.kernel.org
Subject: Re: WWN on FC LUN targets
>I am looking at ways to find out particular WWN (world wide names) for
>SCSI target LUNs
LUNS don't actually have fibre channel WWNs. And neither do SCSI
logical units, which is probably what you meant (a LUN is a logical unit
number).
WWNs come in two flavors - World Wide Node Name (WWNN), which identifies
a SCSI target, and World Wide Port Name (WWPN), which identifies a port
on a target. Neither of those is what you want, since you probably have
multiple logical units per target.
If you're like most FC users, your LUNs aren't stable even within a
target, so you can't use a combination of WWNN and LUN either.
So what people use is either SCSI device serial number or SCSI device
ID.
The latter is newer and better. There are device IDs for targets,
ports, and logical units. There are device IDs in each of various name
spaces, some defined by public standards. You can read all about that
in SCSI specifications. Device IDs are part of the Vital Product Data
(VPD).
The basic programming interface to get that information is the SCSI
INQUIRY command.
People have written programs to do the INQUIRY and give you the results
in usable form and even create the device special files named after the
device IDs. I'm afraid I can't name one at the moment, but I hope
someone else on the list chimes in with the specifics.
You could do this with devfs, but you'd be happier doing it with a user
space program that just queries the devices at all the relevant
major/minor number combinations and creates the /dev files you want.
And the same for responding to hotplug events. In Linux 2.6, that
process is even formalized in 'udev'.
This is, by the way, something people have been doing for years. It's
only starting to become standard so that everyone doesn't have to write
his own.
>I can mount particular [logical units] from any server without worrying
>about changes in the device naming conventions.
Of course, naming conventions are the least of your problems. When you
try to use the /dev/sda etc. names, they will change every time the
slightest thing in your system changes -- recabling, adding adapter
cards, changing adapter card brand, creating new LUs, and on and on.
And they will be different on every system.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org More majordomo info
at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: WWN on FC LUN targets
2004-07-28 14:22 David Peterson (Eng)
@ 2004-07-28 15:46 ` Rock Gordon
2004-07-28 17:09 ` Bryan Henderson
0 siblings, 1 reply; 7+ messages in thread
From: Rock Gordon @ 2004-07-28 15:46 UTC (permalink / raw)
To: David Peterson (Eng), Bryan Henderson; +Cc: linux-scsi
Hello everyone, thanks for your replies.
If I wasn't clear in my earlier posting - let me throw
in some additional clues. The need is to be able to
identifiy logical units (which I refer to as LUNs)
uniquely, no matter where they are and to whichever FC
network they might end up getting connected to at any
given point in time. Each of them will have a
filesystem on it - however this filesystem is served
to the outside world by NFSD (or any other we pick
later on). The issue is that the NFSD serves only
particular filesystems - and they need a unique and
portable way to identify them.
Hence anything that is not portable or not unique
world-wide is suspect. I feel the SCSI device ID falls
in this category.
My network layout is simple - RAID5 JBODs connected
directly to FC switches; and no sub-partitioning done
on the storage JBODs so there's only one LUN on each
of them.
So if a WWWN is indeed assigned to a single SCSI LUN,
can it be found out from any such SCSI LUN connected
to an FC network through any programming interface? I
was looking at drivers/scsi/cpqioctl.c (and got it to
compile after making some changes) - but it apparently
the ioctl does not work for some reason.
A brute force approach would be to write some unique
identifier in a file on the filesystem and to mount
all connected filesystems readonly to read off the
unique numbers from that file. However not only is
this approach not scalable; it also won't work in case
of an mkfs.
Yet another approach would be to record the
host/bus/target/lun of each logical unit. However this
might not work in case of a re-arrangement of the
network or even re-seating HBAs inside the servers
themselves; am I right?
>
> If supported by the device, use the Device
> Identification VPD page
> (0x83) to identify the Logical Unit. See SPC-3.
> The preferred identifier type is NAA (which is a
> Worldwide_Name). Annex
> D in FCP-2/FCP-3 may also be of assistance to you.
>
Thanks David, I guess more reading to be done on my
side :)
Regards,
Rocky
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: WWN on FC LUN targets
2004-07-28 15:46 ` Rock Gordon
@ 2004-07-28 17:09 ` Bryan Henderson
0 siblings, 0 replies; 7+ messages in thread
From: Bryan Henderson @ 2004-07-28 17:09 UTC (permalink / raw)
To: Rock Gordon; +Cc: David Peterson (Eng), linux-scsi
>The need is to be able to
>identifiy logical units (which I refer to as LUNs)
>uniquely, no matter where they are and to whichever FC
>network they might end up getting connected to at any
>given point in time.
That's exactly what the SCSI device ID is for.
>Hence anything that is not portable or not unique
>world-wide is suspect. I feel the SCSI device ID falls
>in this category.
The SCSI device ID, the NAA version in particular, is designed to be
world-wide unique and portable (stays the same no matter where or how in
the world you attach the device).
Since you're working with filesystems, another thing you should consider
is a filesystem serial number. The device ID has the problem that if you
move your filesystem to another logical unit, its ID changes. And if you
replace the filesystem on a logical unit with another filesystem, the new
filesystem has the same ID as the former one. An ext3 filesystem has a
UUID which is supposed to be worldwide unique identifier of the
filesystem. Your idea of placing your own ID file in the filesystem is
similar.
>Yet another approach would be to record the
>host/bus/target/lun of each logical unit. However this
>might not work in case of a re-arrangement of the
>network or even re-seating HBAs inside the servers
>themselves; am I right?
Yes, you should cross that one out. It's only slightly better than using
/dev/sdX.
>So if a [WWNN] is indeed assigned to a single SCSI LUN,
It isn't. It's assigned to the target. Each target can have multiple
logical units. Each logical unit can have multiple LUNs. And since it
isn't a SCSI concept, there's no standard interface in Linux for querying
it. Various FC hardware and driver software have various ways to query
such fibre channel info.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: WWN on FC LUN targets
2004-07-28 0:54 ` Bryan Henderson
@ 2004-08-01 9:05 ` Douglas Gilbert
2004-08-04 17:04 ` Rock Gordon
0 siblings, 1 reply; 7+ messages in thread
From: Douglas Gilbert @ 2004-08-01 9:05 UTC (permalink / raw)
To: Bryan Henderson; +Cc: Rock Gordon, linux-scsi
Bryan Henderson wrote:
>>I am looking at ways to find out particular WWN (world
>>wide names) for SCSI target LUNs
>
>
> LUNS don't actually have fibre channel WWNs. And neither do SCSI logical
> units, which is probably what you meant (a LUN is a logical unit number).
> WWNs come in two flavors - World Wide Node Name (WWNN), which identifies a
> SCSI target, and World Wide Port Name (WWPN), which identifies a port on a
> target. Neither of those is what you want, since you probably have
> multiple logical units per target.
>
> If you're like most FC users, your LUNs aren't stable even within a
> target, so you can't use a combination of WWNN and LUN either.
>
> So what people use is either SCSI device serial number or SCSI device ID.
> The latter is newer and better. There are device IDs for targets, ports,
> and logical units. There are device IDs in each of various name spaces,
> some defined by public standards. You can read all about that in SCSI
> specifications. Device IDs are part of the Vital Product Data (VPD).
>
> The basic programming interface to get that information is the SCSI
> INQUIRY command.
>
> People have written programs to do the INQUIRY and give you the results in
> usable form and even create the device special files named after the
> device IDs. I'm afraid I can't name one at the moment, but I hope someone
> else on the list chimes in with the specifics.
<snip>
The scsi_id program by Patrick Mansfield queries a SCSI device's
identification and serial number vital product data (VPD) pages
and produces a unique number. It is meant to be used in conjunction
with udev (a dynamic device node creation, naming and removal facility
based on the hotplug subsystem in the lk 2.6 series) to create device
(and partition) node names according to user specified rules.
Several versions can be found at this url:
http://www-124.ibm.com/storageio/scsi_id/
The sg_inq utility in the sg3_utils package (version 1.07) has
a '-i' option that will decode all the "identification descriptors"
in the device identification VPD page (0x83) for the nominated device.
That information in conjunction with some of the explanations in
this thread may show you what identifiers, if any, are available.
The unit serial number page can be queried with
'sg_inq -o=80 /dev/sda'.
sg3_utils can be found at: http://www.torque.net/sg
SPC-3 (SCSI Primary Commands) can be found http://www.t10.org
The most recent draft is version 19 and section 7.6.4 and 7.6.11
are relevant.
Doug Gilbert
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: WWN on FC LUN targets
2004-08-01 9:05 ` Douglas Gilbert
@ 2004-08-04 17:04 ` Rock Gordon
0 siblings, 0 replies; 7+ messages in thread
From: Rock Gordon @ 2004-08-04 17:04 UTC (permalink / raw)
To: dougg, Bryan Henderson; +Cc: Rock Gordon, linux-scsi
Hi everyone, thanks once again for your replies!
The sg3_utils is very good - I will probably rely on
them.
On a related note - the /proc/partitions file can
handle only one page worth of entries for 2.4.18,
right? There might be a strong possibility of "losing"
entries due to this restriction. Is there any patch
out there to get around this problem?
Thanks,
>
> The scsi_id program by Patrick Mansfield queries a
> SCSI device's
> identification and serial number vital product data
> (VPD) pages
> and produces a unique number. It is meant to be used
> in conjunction
> with udev (a dynamic device node creation, naming
> and removal facility
> based on the hotplug subsystem in the lk 2.6 series)
> to create device
> (and partition) node names according to user
> specified rules.
> Several versions can be found at this url:
> http://www-124.ibm.com/storageio/scsi_id/
>
> The sg_inq utility in the sg3_utils package (version
> 1.07) has
> a '-i' option that will decode all the
> "identification descriptors"
> in the device identification VPD page (0x83) for the
> nominated device.
> That information in conjunction with some of the
> explanations in
> this thread may show you what identifiers, if any,
> are available.
> The unit serial number page can be queried with
> 'sg_inq -o=80 /dev/sda'.
> sg3_utils can be found at: http://www.torque.net/sg
>
> SPC-3 (SCSI Primary Commands) can be found
> http://www.t10.org
> The most recent draft is version 19 and section
> 7.6.4 and 7.6.11
> are relevant.
>
> Doug Gilbert
>
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-08-04 17:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-27 20:55 WWN on FC LUN targets Rock Gordon
2004-07-28 0:54 ` Bryan Henderson
2004-08-01 9:05 ` Douglas Gilbert
2004-08-04 17:04 ` Rock Gordon
-- strict thread matches above, loose matches on Subject: below --
2004-07-28 14:22 David Peterson (Eng)
2004-07-28 15:46 ` Rock Gordon
2004-07-28 17:09 ` Bryan Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox