Bug 796574 - iscsiadm does not support hostname with port
Summary: iscsiadm does not support hostname with port
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: iscsi-initiator-utils
Version: 6.3
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Andy Grover
QA Contact: Bruno Goncalves
URL:
Whiteboard:
: 800864 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-23 08:38 UTC by Bruno Goncalves
Modified: 2012-06-26 16:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: iscsiadm did not parse the hostname and port properly when they were passed into discovery and login commands. Consequence: The login or discovery operation would fail, because iscsiadm would not be able to fine the record for the portal. Fix: The iscsiadm portal processing was modified to check for ports after hostnames. Result: Hostnames are now supported as portal arguments in iscsiadm.
Clone Of:
Environment:
Last Closed: 2012-06-20 14:49:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0957 0 normal SHIPPED_LIVE iscsi-initiator-utils bug fix and enhancement update 2012-06-19 20:59:34 UTC

Description Bruno Goncalves 2012-02-23 08:38:46 UTC
Description of problem:
When trying to run discovery using hostname and port it does not work.
This problem seems to apply only to host definition on /etc/hosts. With DNS hostname it works fine.

Version-Release number of selected component (if applicable):
iscsi-initiator-utils-6.2.0.872-34.el6.x86_64

How reproducible:

100%

Steps to Reproduce:

1. install scsi-target-utils
2. service tgtd restart
3. tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.1994-05.com.redhat:tgtd-1
4. tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
5. Create disk for LUN: mktemp /tmp/disk.XXXXX
        dd if=/dev/zero of=/tmp/disk.XXXXX bs=1M count=0 seek=100
6. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /tmp/disk.XXXXX

7.
iscsiadm -m discovery -t st -p "localhost:3260" -I default  -P1
iscsiadm: Cannot resolve host localhost:3260. getaddrinfo error: [Name or service not known]

iscsiadm: cannot resolve host name localhost:3260
iscsiadm: cannot resolve host name localhost:3260
iscsiadm: No portals found

---------------

For DNS hostname it works
iscsiadm -m discovery -t st -p "localhost.localdomain:3260" -I default  -P1
Target: iqn.1994-05.com.redhat:tgtd-1
	Portal: [::1]:3260,1
		Iface Name: default


Actual results:
Cannot resolve host

Expected results:
Discovery should work

Comment 2 Mike Christie 2012-03-08 00:19:55 UTC
*** Bug 800864 has been marked as a duplicate of this bug. ***

Comment 3 Mike Christie 2012-03-22 09:30:19 UTC
Fixed in iscsi-initiator-utils-6.2.0.872-37.el6.

Comment 5 Bruno Goncalves 2012-03-22 16:57:59 UTC
This bug has been fixed on iscsi-initiator-utils-6.2.0.872-37.el6.

--------
service tgtd restart
Stopping SCSI target daemon: not running                   [FAILED]
Starting SCSI target daemon:                               [  OK  ]

tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.1994-05.com.redhat:tgtd-1

tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

dd if=/dev/zero of=/tmp/disk.1 bs=1M count=0 seek=100
0+0 records in
0+0 records out
0 bytes (0 B) copied, 3.599e-05 s, 0.0 kB/s

tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /tmp/disk.1

iscsiadm -m discovery -t st -p "localhost:3260" -I default  -P1
Starting iscsid:                                           [  OK  ]
Target: iqn.1994-05.com.redhat:tgtd-1
        Portal: [::1]:3260,1
                Iface Name: default

iscsiadm -m node -l
Logging in to [iface: default, target: iqn.1994-05.com.redhat:tgtd-1, portal: ::1,3260] (multiple)
Login to [iface: default, target: iqn.1994-05.com.redhat:tgtd-1, portal: ::1,3260] successful.

Comment 6 Bruno Goncalves 2012-03-22 17:12:42 UTC
Looks like there was some regression using localhost IPV6 format (::1).

If add it [] ([::1]) works. 

----------

rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.872-36.el6.x86_64

iscsiadm -m discovery -t st -p "::1" -I default  -P1
Starting iscsid:                                           [  OK  ]
Target: iqn.1994-05.com.redhat:tgtd-1
        Portal: [::1]:3260,1
                Iface Name: default



rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.872-37.el6.x86_64

iscsiadm -m discovery -t st -p "::1" -I default  -P1
Starting iscsid:                                           [  OK  ]
iscsiadm: Cannot resolve host . getaddrinfo error: [Name or service not known]

iscsiadm: cannot resolve host name 
iscsiadm: cannot resolve host name 
iscsiadm: No portals found


iscsiadm -m discovery -t st -p "[::1]" -I default  -P1
Target: iqn.1994-05.com.redhat:tgtd-1
        Portal: [::1]:3260,1
                Iface Name: default

Comment 7 Mike Christie 2012-03-23 04:27:29 UTC
Fixed in iscsi-initiator-utils-6.2.0.872-38.el6.

Comment 8 Bruno Goncalves 2012-03-23 14:16:35 UTC
Everything is working now on iscsi-initiator-utils-6.2.0.872-38.el6.x86_64

rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.872-38.el6.x86_64

service tgtd restart
Stopping SCSI target daemon: not running                   [FAILED]
Starting SCSI target daemon:                               [  OK  ]

tgtadm --lld iscsi --op new --mode target --tid 1 -T
iqn.1994-05.com.redhat:tgtd-1

tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

dd if=/dev/zero of=/tmp/disk.1 bs=1M count=0 seek=100
0+0 records in
0+0 records out
0 bytes (0 B) copied, 3.599e-05 s, 0.0 kB/s

tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /tmp/disk.1

iscsiadm -m discovery -t st -p "::1" -I default  -P1
Starting iscsid:                                           [  OK  ]
Target: iqn.1994-05.com.redhat:tgtd-1
        Portal: [::1]:3260,1
                Iface Name: default

iscsiadm -m discovery -t st -p "localhost:3260" -I default  -P1
Starting iscsid:                                           [  OK  ]
Target: iqn.1994-05.com.redhat:tgtd-1
        Portal: [::1]:3260,1
                Iface Name: default

Comment 9 Mike Christie 2012-05-02 03:57:07 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: iscsiadm did not parse the hostname and port properly when they were passed into discovery and login commands.
Consequence: The login or discovery operation would fail, because iscsiadm would not be able to fine the record for the portal.
Fix: The iscsiadm portal processing was modified to check for ports after hostnames.
Result: Hostnames are now supported as portal arguments in iscsiadm.

Comment 10 errata-xmlrpc 2012-06-20 14:49:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0957.html


Note You need to log in before you can comment on or make changes to this bug.