Bug 1015563 - iscsiadm: "iscsiadm -m node -l" fails if there is already some session
iscsiadm: "iscsiadm -m node -l" fails if there is already some session
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iscsi-initiator-utils (Show other bugs)
7.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Chris Leech
Bruno Goncalves
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-04 09:51 EDT by Bruno Goncalves
Modified: 2014-11-18 11:52 EST (History)
3 users (show)

See Also:
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 08:54:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bruno Goncalves 2013-10-04 09:51:57 EDT
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 09:56:32 EDT
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 07:22:57 EST
It does not affect only leading login, but it fails any time there is already an online session.
Comment 7 Chris Leech 2014-02-19 19:28:54 EST
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 08:12:10 EST
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 08:54:33 EDT
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 08:14:22 EST
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 11:52:40 EST
Sorry, this was false alarm, both 873-10 and 873-13 works as expected.

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