open-iscsi, scst & specific lun number

353 views
Skip to first unread message

Евгений Мартынов

unread,
Feb 2, 2012, 4:53:50 AM2/2/12
to open-iscsi
Hello,

Ive spent many time to find and answer, and did not have a luck.

I have scst target with configuration:
scstadmin --list_group

Driver: iscsi
Target: iqn.2011-09.dev.st1.acc

Group: iqn.2012-01-10.ru.host1:openiscsi

Assigned LUNs:

LUN Device
-----------
100 vdisk1


Assigned Initiators:

Initiator
-----------------------------------------------------------
iqn.2012-01-10.ru.host1:openiscsi

So, my LUN have a number 100.

Initiator discover/login to target seccesfully and creates specific
host in /sys/class/scsi_host
I can also send a manual scan like echo "- - 100" to /sys/class/
scsi_host/hostN/scan and my device now is persist in system.

As far as i know, scst supports up to 16383 lun number.

And if i add some another large lun number, it does not takes
automatically (REPORT_LUNS_DATA_CHANGED works, but initiator not see
large numbers).

Q: Is the way to do automatically scaning in open-iscsi initiator for
seeing all custom luns (not only 0-7)? I`m undestand, what it not good
idea to scan all luns of range 0-16383 at start point, but i think it
is may be possible to do this thru report luns, such as can do sg_luns
-s2 /dev/sd*.

Mike Christie

unread,
Feb 2, 2012, 8:54:30 PM2/2/12
to open-...@googlegroups.com, Евгений Мартынов

It should do this now automatically.

> idea to scan all luns of range 0-16383 at start point, but i think it
> is may be possible to do this thru report luns, such as can do sg_luns
> -s2 /dev/sd*.

After the initiator logs in, it asks the scsi layer to find scsi
devices. The scsi layer does a inquiry to LUN 0, then will do a
REPORT_LUNs command. The target then will tell is the LUNs and the scsi
layer will add them.

Note that the default max lun value iscsi_tcp supports is 512. This can
be overridden by doing using the iscsi_tcp max_lun modparam "modinfo
iscsi_tcp" for info.

modparam iscsi_tcp max_lun=whatever_value_you_want.

or you can do

echo X > /sys/module/iscsi_tcp/paramters/max_lun

before you run the login command.


Send a tcpdump/wireshark trace for when you do the iscsiadm login
command, so we can see what the target and initiator are sending.

Could you also send the /var/log/messages for when the login command is run.


Ulrich Windl

unread,
Feb 3, 2012, 2:25:13 AM2/3/12
to open-iscsi
Hi!

I'm no specialist on the SCSI protocol, but I always thought LUNs are restricted to 0-7 (maybe 0-15). On larger storage systems I've seen "big" LUN numbers are mapped to varying targets. On HP-UX they use a pattern like

(LUN / 128), (LUN/8), LUN for "port", "bus" and "target", so this is an example:

disk 45 0/7/1/0.99.16.19.0.10.1 sdisk CLAIMED DEVICE HP HSV200

Adapter 0/7/1/0, Domain 99, Area 16, Port 19, Bus 0, Target 10, LUN 1 (LUN 81)

So "bus 0, target 10, lun 1" actually refers to "lun 81".

I don't know how Linux works there.

Regards,
Ulrich

>>> ??????? ????????<e.i.ma...@gmail.com> schrieb am 02.02.2012 um 10:53 in
Nachricht
<4de2e2fe-a256-4c0c...@a15g2000yqf.googlegroups.com>:

Евгений Мартынов

unread,
Feb 3, 2012, 6:45:00 AM2/3/12
to open-iscsi
> After the initiator logs in, it asks the scsi layer to find scsi
> devices. The scsi layer does a inquiry to LUN 0, then will do a
> REPORT_LUNs command. The target then will tell is the LUNs and the scsi
> layer will add them.
>

Yes, it works, thank you. I just add LUN0 to taget.

Another Q:

Is it really necessary to use LUN 0 to do all this operations? Is
there the way to override this behavior and send REPORT LUNs command
without any LUN connected (to bus/host)?


> Note that the default max lun value iscsi_tcp supports is 512. This can
> be overridden by doing using the iscsi_tcp max_lun modparam "modinfo
> iscsi_tcp" for info.
>
> modparam iscsi_tcp max_lun=whatever_value_you_want.
>
> or you can do
>
> echo X > /sys/module/iscsi_tcp/paramters/max_lun
>
> before you run the login command.

Seems to read only value for me.
But adding "options iscsi_tcp max_lun=16383" to modprobe.conf works
fine.

Mike Christie

unread,
Feb 3, 2012, 9:03:10 AM2/3/12
to open-...@googlegroups.com, Евгений Мартынов
On 02/03/2012 05:45 AM, Евгений Мартынов wrote:
>> After the initiator logs in, it asks the scsi layer to find scsi
>> devices. The scsi layer does a inquiry to LUN 0, then will do a
>> REPORT_LUNs command. The target then will tell is the LUNs and the scsi
>> layer will add them.
>>
>
> Yes, it works, thank you. I just add LUN0 to taget.
>
> Another Q:
>
> Is it really necessary to use LUN 0 to do all this operations? Is

Yeah. I think it is a scsi spec issue/requirement.

> there the way to override this behavior and send REPORT LUNs command
> without any LUN connected (to bus/host)?
>
>
>> Note that the default max lun value iscsi_tcp supports is 512. This can
>> be overridden by doing using the iscsi_tcp max_lun modparam "modinfo
>> iscsi_tcp" for info.
>>
>> modparam iscsi_tcp max_lun=whatever_value_you_want.
>>
>> or you can do
>>
>> echo X > /sys/module/iscsi_tcp/paramters/max_lun
>>
>> before you run the login command.
>
> Seems to read only value for me.

Ah you are right. I never turned on write support through sysfs. This
has not come up very often. I will send a patch to fix it up.

Reply all
Reply to author
Forward
0 new messages