Bug 1322208

Summary: cannot find iscsi targets with ipv6, got "connection refused" error
Product: Red Hat Enterprise Linux 7 Reporter: yisun
Component: targetcliAssignee: Andy Grover <agrover>
Status: CLOSED NOTABUG QA Contact: Storage QE <storage-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-30 06:56:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description yisun 2016-03-30 02:46:34 UTC
Description of problem:
cannot find iscsi targets with ipv6, got "connection refused" error

Version-Release number of selected component (if applicable):
targetcli-2.1.fb41-3.el7.noarch
iscsi-initiator-utils-6.2.0.873-32.el7.x86_64
kernel-3.10.0-327.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. prepared iscsi targets with targetcli on localhost

2.use IPv6 to find targets, got "Connection refused" error
# iscsiadm --mode discovery --type sendtargets --portal ::1
iscsiadm: cannot make connection to ::1: Connection refused
iscsiadm: cannot make connection to ::1: Connection refused
iscsiadm: cannot make connection to ::1: Connection refused

# ping6 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.020 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.025 ms
...

3.use IPv4, everything goes well
# iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1
127.0.0.1:3260,1 iqn.2016-03.com.virttest:emulated-image.target

Actual results:
As above, ipv6 doesn't work

Expected results:
IPv6 should work well. 

Additional info:
I searched some related bugs:
1239046
1239114
888191 <=== this one seems exactly the same issue, but it's been fixed.

Comment 2 yisun 2016-03-30 06:56:09 UTC
Confirmed with dev, this is a default setting issue. So close this as Not A Bug

<bgoncalv> okay, I see the problem
<bgoncalv> targetcli by default enables only IPv4 portals
<bgoncalv> you need to delete portal "0.0.0.0" and add "::0"
<bgoncalv> this will enable connection from IPv4 and IPv6 addresses
<yisun> so delete 0.0.0.0 won't effect ipv4, correct?
<bgoncalv> it wont
<yisun> where to delete the portal setting? or command line?
<bgoncalv> targetcli /iscsi/iqn.2016-03.com.virttest:emulated-image.target/tpg1/portals delete 0.0.0.0 3260
<bgoncalv> should do it
<bgoncalv> then: targetcli /iscsi/iqn.2016-03.com.virttest:emulated-image.target/tpg1/portals create ::0
<yisun> yes, it works!
<bgoncalv> cool
<yisun> thx for the guide
<bgoncalv> np, can you update the BZ or should I do it?
<yisun> I'll update and close it, thx
<bgoncalv> yw