iscsiadm login fails when hostname is specified instead of IP address

337 views
Skip to first unread message

Ashutosh Naik

unread,
Oct 21, 2008, 1:43:43 PM10/21/08
to open-...@googlegroups.com, Mike Christie
Hi,

I am logging to the iSCSI Enterprise target and observe the following
behaviour. I am using open-iscsi version 2.0-869.2

The discovery session seems to resolve the hostname to an IP address well.

[root@california ~]# iscsiadm --mode discovery --type sendtargets --portal sw01
10.192.166.103:3260,1 iqn.2004-05.com.faker.sw01

But while logging in, this resolution fails

[root@california ~]# iscsiadm -m node --portal sw01 --login
iscsiadm: no records found!

It works fine after I use the IP address instead of the hostname

[root@california ~]# iscsiadm -m node --portal 10.192.166.103 --login
Logging in to [iface: default, target: iqn.2004-05.com.faker.sw01,
portal: 10.192.166.103,3260]
Login to [iface: default, target: iqn.2004-05.com.faker.sw01, portal:
10.192.166.103,3260]: successful

It's easily reproducible

Thanks
Ashutosh

Mark Chaney

unread,
Oct 21, 2008, 3:28:00 PM10/21/08
to open-...@googlegroups.com
Maybe im missing something, but where does it say that hostnames are
supported?

Ashutosh Naik

unread,
Oct 21, 2008, 10:13:56 PM10/21/08
to open-...@googlegroups.com
>> [root@california ~]# iscsiadm -m node --portal sw01 --login
>> iscsiadm: no records found!

>> It works fine after I use the IP address instead of the hostname

>> [root@california ~]# iscsiadm -m node --portal 10.192.166.103 --login
>> Logging in to [iface: default, target: iqn.2004-05.com.faker.sw01,
>> portal: 10.192.166.103,3260]
>> Login to [iface: default, target: iqn.2004-05.com.faker.sw01, portal:
>> 10.192.166.103,3260]: successful

>> It's easily reproducible

On Tue, Oct 21, 2008 at 12:28 PM, Mark Chaney <mac...@macscr.com> wrote:
>
> Maybe im missing something, but where does it say that hostnames are
> supported?


Yes, if I look at the code, then it does resolve hostnames at various
points during discovery and login, hence I think that this is a bug.
What I think is that even if we specify a hostname, whilst discovery,
an IP address format file is created in
/etc/iscsi/node/<target-name>/<ip-address>,<port> and
/etc/iscsi/send_targets/<ip-address>,<port> hence during login, we
cant specify the hostname as it directly reads from this directory.

Many Thanks,
Ashutosh

Mike Christie

unread,
Oct 22, 2008, 10:44:45 AM10/22/08
to Ashutosh Naik, open-...@googlegroups.com
Ashutosh Naik wrote:
> Hi,
>
> I am logging to the iSCSI Enterprise target and observe the following
> behaviour. I am using open-iscsi version 2.0-869.2
>
> The discovery session seems to resolve the hostname to an IP address well.
>
> [root@california ~]# iscsiadm --mode discovery --type sendtargets --portal sw01
> 10.192.166.103:3260,1 iqn.2004-05.com.faker.sw01
>
> But while logging in, this resolution fails
>
> [root@california ~]# iscsiadm -m node --portal sw01 --login
> iscsiadm: no records found!

The iscsiadm command takes the portal that is returned by the target, so
if the target returns ips then you have to use ips. If the target
returns hosts then you have to use that.

Mike Christie

unread,
Oct 22, 2008, 10:47:12 AM10/22/08
to open-...@googlegroups.com
Ashutosh Naik wrote:
>>> [root@california ~]# iscsiadm -m node --portal sw01 --login
>>> iscsiadm: no records found!
>
>>> It works fine after I use the IP address instead of the hostname
>
>>> [root@california ~]# iscsiadm -m node --portal 10.192.166.103 --login
>>> Logging in to [iface: default, target: iqn.2004-05.com.faker.sw01,
>>> portal: 10.192.166.103,3260]
>>> Login to [iface: default, target: iqn.2004-05.com.faker.sw01, portal:
>>> 10.192.166.103,3260]: successful
>
>>> It's easily reproducible
>
> On Tue, Oct 21, 2008 at 12:28 PM, Mark Chaney <mac...@macscr.com> wrote:
>> Maybe im missing something, but where does it say that hostnames are
>> supported?
>
>
> Yes, if I look at the code, then it does resolve hostnames at various
> points during discovery and login, hence I think that this is a bug.
> What I think is that even if we specify a hostname, whilst discovery,

What gets created below in /etc/iscsi/nodes is determined by what the
target returns to us during discovery. So like I said in the other mail,
if the target returns ips we end up make the ip-address a ip. If it
returns a hostname we would use that to make the dir. If you are saying
the target returns hostnames and that is not working then that is a bug.

Ashutosh Naik

unread,
Oct 22, 2008, 12:19:21 PM10/22/08
to open-...@googlegroups.com
On Wed, Oct 22, 2008 at 7:47 AM, Mike Christie <mich...@cs.wisc.edu> wrote:
>
> Ashutosh Naik wrote:
>>>> [root@california ~]# iscsiadm -m node --portal sw01 --login
>>>> iscsiadm: no records found!
>>
>>>> It works fine after I use the IP address instead of the hostname
>>
>>>> [root@california ~]# iscsiadm -m node --portal 10.192.166.103 --login
>>>> Logging in to [iface: default, target: iqn.2004-05.com.faker.sw01,
>>>> portal: 10.192.166.103,3260]
>>>> Login to [iface: default, target: iqn.2004-05.com.faker.sw01, portal:
>>>> 10.192.166.103,3260]: successful
>>
>>>> It's easily reproducible
>>
>> On Tue, Oct 21, 2008 at 12:28 PM, Mark Chaney <mac...@macscr.com> wrote:
>>> Maybe im missing something, but where does it say that hostnames are
>>> supported?
>>
>>
>> Yes, if I look at the code, then it does resolve hostnames at various
>> points during discovery and login, hence I think that this is a bug.
>> What I think is that even if we specify a hostname, whilst discovery,
>
> What gets created below in /etc/iscsi/nodes is determined by what the
> target returns to us during discovery. So like I said in the other mail,
> if the target returns ips we end up make the ip-address a ip. If it
> returns a hostname we would use that to make the dir. If you are saying
> the target returns hostnames and that is not working then that is a bug.

Would it not be good if we were able to use IP addresses and hostnames
interchangeably for login? If the initiator can reach the hostname
allright then can we try to do a mapping, instead of using the
hardcoded values that we store during discovery?

Reply all
Reply to author
Forward
0 new messages