* iSCSI device naming issues
@ 2004-07-01 13:58 Surekha.PC
2004-07-01 15:57 ` Mike Anderson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Surekha.PC @ 2004-07-01 13:58 UTC (permalink / raw)
To: 'SCSI Mailing List'
Whenever an iSCSI device is configured in the system, a hotplug
event is generated which invokes udev for device node creation.
iSCSI driver has a CALLOUT rule for udev to generate a unique
name for iSCSI devices.
The iSCSI callout program receives a sysfs device path like
/sys/block/sdc whenever a block device is added. From the device
symlink under /sys/block/sdc, it obtains the corresponding device
path under /sys/devices/.. . It extracts the device quadruple
(c,b,t,l) and identifies iSCSI device by parsing the path
/sys/class/scsi_host/iscsi/c:b:t:l. For c:b:t:l as 0:0:0:0,
iSCSI device name will be /udev/iscsib0t0l0.
P.S: <hostX> is replaced by "iscsi" above to lookup for iSCSI devices.
So, we are overwriting <hostX> as "iscsi" to help in device lookup,
which is not a good idea as pointed by Mike Christie and trying to
find out best way to achieve the same. Here are few options:
1) Having an iSCSI pseudo bus.
This will create a fake iscsi bus as "/sys/bus/iscsi" and all devices
will be under this pseudo bus. This can be used to lookup iSCSI
devices. I don't see any other use of this fake bus. Is it still
ok to pursue with this approach?
2) Having an attribute for iSCSI host which displays the name of
iSCSI driver as shown:
$cat /sys/class/scsi_host/hostX/hostname
"iSCSI SFnet Driver"
This can be used for lookup purpose. Is this acceptable?
3) Make use of scsi_id.
scsi_id can be used to get unique name instead of parsing sysfs
path for device name creation. However scsi_id is helpful only
for block devices, and there is no way to handle unique naming
for tape devices. So this will not make a complete solution.
Thoughts?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iSCSI device naming issues
2004-07-01 13:58 iSCSI device naming issues Surekha.PC
@ 2004-07-01 15:57 ` Mike Anderson
2004-07-01 17:29 ` udev naming of st devices [was Re: iSCSI device naming issues] Patrick Mansfield
2004-07-04 19:57 ` iSCSI device naming issues Arjan van de Ven
2004-07-04 20:11 ` Christoph Hellwig
2 siblings, 1 reply; 6+ messages in thread
From: Mike Anderson @ 2004-07-01 15:57 UTC (permalink / raw)
To: Surekha.PC; +Cc: 'SCSI Mailing List'
Surekha.PC [surekhap@cisco.com] wrote:
> 1) Having an iSCSI pseudo bus.
> This will create a fake iscsi bus as "/sys/bus/iscsi" and all devices
> will be under this pseudo bus. This can be used to lookup iSCSI
> devices. I don't see any other use of this fake bus. Is it still
> ok to pursue with this approach?
>
This sounds like the wrong approach.
> 2) Having an attribute for iSCSI host which displays the name of
> iSCSI driver as shown:
>
> $cat /sys/class/scsi_host/hostX/hostname
> "iSCSI SFnet Driver"
If you set proc_name in your template this value will show up under
/sys/class/scsi_host/host<n>/proc_name.
> 3) Make use of scsi_id.
> scsi_id can be used to get unique name instead of parsing sysfs
> path for device name creation. However scsi_id is helpful only
> for block devices, and there is no way to handle unique naming
> for tape devices. So this will not make a complete solution.
Well you can still setup a udev rule to use scsi_id for you block
devices and then use location naming for the tapes ( some newer
generation tape drives also support serial numbers).
-andmike
--
Michael Anderson
andmike@us.ibm.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* udev naming of st devices [was Re: iSCSI device naming issues]
2004-07-01 15:57 ` Mike Anderson
@ 2004-07-01 17:29 ` Patrick Mansfield
0 siblings, 0 replies; 6+ messages in thread
From: Patrick Mansfield @ 2004-07-01 17:29 UTC (permalink / raw)
To: Surekha.PC, 'SCSI Mailing List', linux-hotplug-devel
[adding linux-hotplug-devel]
On Thu, Jul 01, 2004 at 08:57:14AM -0700, Mike Anderson wrote:
> Surekha.PC [surekhap@cisco.com] wrote:
> > 3) Make use of scsi_id.
> > scsi_id can be used to get unique name instead of parsing sysfs
> > path for device name creation. However scsi_id is helpful only
> > for block devices, and there is no way to handle unique naming
> > for tape devices. So this will not make a complete solution.
>
> Well you can still setup a udev rule to use scsi_id for you block
> devices and then use location naming for the tapes ( some newer
> generation tape drives also support serial numbers).
Yes, I had no problems running scsi_id on some older DLT drives (DLT
4000?).
There is a naming issue with st, in that unique tape names need to put an
identifier in the middle of the different names, or at least parse out a
middle portion of the kernel name.
That is, tape names are of the form:
st13
st13a
st13l
st13m
nst13
nst13a
nst13l
nst13m
So if you want a unique name in the above, you would generally want to
substitute the 13 with a value.
You can't do this with a one line udev rule, using scsi_id with an eight
line rule (each one containing the same scsi_id value to match) is ugly,
and I'm not sure if it would work (udev wildcard pattern matching for
things like st[0-9]*l).
A script could be written to handle this, it would be passed a kernel
name, a scsi_id value to match and a name string. It would call scsi_id,
and if it matches the passed in value, return the name string for the
device wrapped with pre and post fixes.
Or maybe udev can be changed to better handle this, but I don't have
suggestions or patches.
Changing st default kernel names would simplify the problem, but is not
allowed.
-- Patrick Mansfield
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iSCSI device naming issues
2004-07-01 13:58 iSCSI device naming issues Surekha.PC
2004-07-01 15:57 ` Mike Anderson
@ 2004-07-04 19:57 ` Arjan van de Ven
2004-07-07 9:05 ` Surekha.PC
2004-07-04 20:11 ` Christoph Hellwig
2 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2004-07-04 19:57 UTC (permalink / raw)
To: Surekha.PC; +Cc: 'SCSI Mailing List'
[-- Attachment #1: Type: text/plain, Size: 363 bytes --]
On Thu, 2004-07-01 at 15:58, Surekha.PC wrote:
> Whenever an iSCSI device is configured in the system, a hotplug
> event is generated which invokes udev for device node creation.
> iSCSI driver has a CALLOUT rule for udev to generate a unique
> name for iSCSI devices.
wouldn't this all be a lot cleaner if you follow the
one-hba-per-remote-host model ?
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iSCSI device naming issues
2004-07-01 13:58 iSCSI device naming issues Surekha.PC
2004-07-01 15:57 ` Mike Anderson
2004-07-04 19:57 ` iSCSI device naming issues Arjan van de Ven
@ 2004-07-04 20:11 ` Christoph Hellwig
2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2004-07-04 20:11 UTC (permalink / raw)
To: Surekha.PC; +Cc: 'SCSI Mailing List'
On Thu, Jul 01, 2004 at 07:28:03PM +0530, Surekha.PC wrote:
>
> Whenever an iSCSI device is configured in the system, a hotplug
> event is generated which invokes udev for device node creation.
> iSCSI driver has a CALLOUT rule for udev to generate a unique
> name for iSCSI devices.
>
> The iSCSI callout program receives a sysfs device path like
> /sys/block/sdc whenever a block device is added. From the device
> symlink under /sys/block/sdc, it obtains the corresponding device
> path under /sys/devices/.. . It extracts the device quadruple
> (c,b,t,l) and identifies iSCSI device by parsing the path
> /sys/class/scsi_host/iscsi/c:b:t:l. For c:b:t:l as 0:0:0:0,
> iSCSI device name will be /udev/iscsib0t0l0.
> P.S: <hostX> is replaced by "iscsi" above to lookup for iSCSI devices.
Please just use the standard naming scheme instead of inventing
your own names.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: iSCSI device naming issues
2004-07-04 19:57 ` iSCSI device naming issues Arjan van de Ven
@ 2004-07-07 9:05 ` Surekha.PC
0 siblings, 0 replies; 6+ messages in thread
From: Surekha.PC @ 2004-07-07 9:05 UTC (permalink / raw)
To: arjanv; +Cc: 'SCSI Mailing List'
> On Thu, 2004-07-01 at 15:58, Surekha.PC wrote:
> > Whenever an iSCSI device is configured in the system, a
> hotplug event
> > is generated which invokes udev for device node creation.
> iSCSI driver
> > has a CALLOUT rule for udev to generate a unique name for iSCSI
> > devices.
>
> wouldn't this all be a lot cleaner if you follow the
> one-hba-per-remote-host model ?
>
Are you referring to one hba per Discovery IP?
Even if I have single or multiple HBA, the current scheme of
things is not going to solve iSCSI device naming problem. I
have to anyway lookup sysfs path to identify iSCSI devices.
-Surekha
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-07-07 9:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-01 13:58 iSCSI device naming issues Surekha.PC
2004-07-01 15:57 ` Mike Anderson
2004-07-01 17:29 ` udev naming of st devices [was Re: iSCSI device naming issues] Patrick Mansfield
2004-07-04 19:57 ` iSCSI device naming issues Arjan van de Ven
2004-07-07 9:05 ` Surekha.PC
2004-07-04 20:11 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox