Bug 1015563

Summary: iscsiadm: "iscsiadm -m node -l" fails if there is already some session
Product: Red Hat Enterprise Linux 7 Reporter: Bruno Goncalves <bgoncalv>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED CURRENTRELEASE QA Contact: Bruno Goncalves <bgoncalv>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: agrover, cleech, nsoffer
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iscsi-initiator-utils-6.2.0.873-20.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1108535 (view as bug list) Environment:
Last Closed: 2014-06-13 12:54:33 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:
Embargoed:

Description Bruno Goncalves 2013-10-04 13:51:57 UTC
Description of problem:
Trying to login to a target using 2 interfaces with leading login functionality fails.

Version-Release number of selected component (if applicable):
rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.873-15.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Configure iscsid.conf to use leading login.
    node.startup = automatic
    node.leading_login = Yes

2. start iscsid service
service iscsid restart
Redirecting to /bin/systemctl restart  iscsid.service

3. discover target
iscsiadm -m discovery -I test1 -I test2 -p na3170b.lab.bos.redhat.com -t st
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773


4. Login to 1 interface (it works fine)
iscsiadm -m node -L automatic
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.


5. login to remaining interfaces (here it fails)
iscsiadm -m node -l
iscsiadm: test1: 1 session requested, but 1 already present.
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
iscsiadm: test1: 1 session requested, but 1 already present.
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.
iscsiadm: Could not log into all portals

echo $?
15

Comment 2 Bruno Goncalves 2013-10-04 13:56:32 UTC
rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.873-7.el7.x86_64

iscsiadm -m discovery -I test1 -I test2 -p na3170b.lab.bos.redhat.com -t st
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773


iscsiadm -m node -L automatic
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.

iscsiadm -m node -l
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.

Comment 5 Bruno Goncalves 2014-01-17 12:22:57 UTC
It does not affect only leading login, but it fails any time there is already an online session.

Comment 7 Chris Leech 2014-02-20 00:28:54 UTC
This upstream change moved the printed message from a debug classification to a warning and changed the exit code from 0 to 15 (ISCSI_ERR_SESS_EXISTS) when requesting a login to a node record that already has an active session.

I believe all newly requested sessions are created, and it's only the warnings and exit code that have changed.

Given the problems this can cause in scripted environments, I'm planning on backing this patch out.

--- a/usr/session_mgmt.c
+++ b/usr/session_mgmt.c
@@ -178,12 +178,12 @@ int iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
                goto done;
        }
        if (session_count >= rec->session.nr_sessions) {
-               log_debug(1, "%s: %d session%s requested, but %d "
+               log_warning("%s: %d session%s requested, but %d "
                          "already present.",
                          rec->iface.name, rec->session.nr_sessions,
                          rec->session.nr_sessions == 1 ? "" : "s",
                          session_count);
-               rc = 0;
+               rc = ISCSI_ERR_SESS_EXISTS;
                goto done;
        }

Comment 9 Bruno Goncalves 2014-02-26 13:12:10 UTC
Verified with iscsi-initiator-utils-6.2.0.873-20.el7.x86_64


iscsiadm -m discovery -I test1 -I test2 -p na3170b.lab.bos.redhat.com -t st
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773

iscsiadm -m node -L automatic
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test1, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.

# iscsiadm -m node -l
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: test2, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.


# echo $?
0

Comment 10 Ludek Smid 2014-06-13 12:54:33 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 12 Nir Soffer 2014-11-18 13:14:22 UTC
Same issue exists now in EL 6.5 and 6.6. When this bug was fixed, the version on EL 6.5 was 872-15. Now EL 6.5 is providing 873-10 and EL 6.6 873-13.

This issue is a critical issue for RHEV - iscsiadm must keep the original behavior.

Comment 13 Nir Soffer 2014-11-18 16:52:40 UTC
Sorry, this was false alarm, both 873-10 and 873-13 works as expected.