Skip to contentSkip to conversation

iSCSI HBA needs to have a unique host id

DISCUSSION Surekha.PC 4 participants 4 messages Nov 14, 2003 SCSI

lore
Share & tools
lore

Surekha.PC

author
#0 lore raw

Hi all,

The host id for iSCSI HBA does not remain unique with 2.6 linux
kernel. It keeps changing when iSCSI host is added and removed dynamically. This is a problem for persistent device naming for iSCSI devices through host id.

It would be good to maintain a database of already allocated host id's for the existing hosts. This would render the iSCSI HBA to get the same controller id, irrespective of loading/unloading the driver repeatedly.

Would like to know if there is any provision in 2.6 to achieve the above?

thanks,
surekha

#1 lore raw
Quoted 7 lines · Surekha.PC

Hi all,

The host id for iSCSI HBA does not remain unique with 2.6 linux
kernel. It keeps changing when iSCSI host is added and removed dynamically. This is a problem for persistent device naming for iSCSI devices through host id.

Surekha,

Persistent device naming should be handled through userspace application so that the policy of the device naming is more controllable. I suggest examining the uSDE project www.sourceforge.net/projects/usde for an example implementation. In this case, target disks can be persistently named by their unique IEEE identifier and HBAs can be persistently named by their PCI slot path address. These are only sample policies that could be implemented.. The usde framework allows for any policy to be implemented.

Thanks
-steve

Quoted 16 lines

It would be good to maintain a database of already allocated host id's for the existing hosts. This would render the iSCSI HBA to get the same controller id, irrespective of loading/unloading the driver repeatedly.

Would like to know if there is any provision in 2.6 to achieve the above?

thanks,
surekha

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 3 lines · Steven Dake

I suggest
examining the uSDE project www.sourceforge.net/projects/usde for an example implementation.

I suggest you look at the udev project instead since uSDE is unlikely to be used by more than a tiny minority of systems.

http://lwn.net/Articles/55176/

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#3 lore raw
In reply to Surekha.PC
Quoted 11 lines · Surekha.PC

Hi all,

The host id for iSCSI HBA does not remain unique with 2.6 linux
kernel. It keeps changing when iSCSI host is added and removed dynamically. This is a problem for persistent device naming for iSCSI devices through host id.

It would be good to maintain a database of already allocated host id's for the existing hosts. This would render the iSCSI HBA to get the same controller id, irrespective of loading/unloading the driver repeatedly.

The N in hostN has to be unique across all hosts, since we have /sysfs/class/scsi_host/hostN.

Quoted 2 lines

Would like to know if there is any provision in 2.6 to achieve the above?

udev + scsi_id will be able to give persistent names to any SCSI attached storage that supply a unique ID, including iSCSI.

If you want to name based on location (like host, chan, id, lun), udev has a topology and "place" matching. It needs work so we can wild card the host number and use it for scsi, and it has to include the parent name for scsi, but the general idea is include in udev (I'm not working on this for udev).

As long as the iSCSI uses a parent that has unique and relevant name, then the udev place can be modified to work.

i.e for pci we have:

[elm3b79 patman]$ ls /sysfs/devices/pci0000:01/0000:01:0c.0/host5/5:0:6:0

block   detach_state    model   queue_depth  rev         type
delete  device_blocked  online  rescan       scsi_level  vendor

So if you could use "place" with wildcards something like:

	0000:01:0c.0/*/*:0:6:0

We could use it to name scsi devices based on location.

It would be nice if the host number was a tag or name based on the
parent's name (or as you say stored), but then we would have to encode the parent's bus or such to avoid name collision, and the scsi_device bus_id names get long.

For sysfs devices would look like:

devices/pci0000:01/0000:01:0c.0/host_pci_0000:01:0c.0/pci_0000:01:0c.0:0:6:0

And:

/sysfs/class/scsi_host/pci_0000:01:0c.0:0:6:0

So the hostN is replaced by the <parent's bus>_<parent's bus_id>, ugly, but then the scsi device bus_id is unique, and (assuming the parent assigned channels and target id's the same) can by itself be used with udev's "place" with no modifications to udev.

-- Patrick Mansfield