Bug 726970 - [vdsm] [iscsiadm] bad error return code in (24 - iSCSI login failed due to authorization failure) [RFE]
Summary: [vdsm] [iscsiadm] bad error return code in (24 - iSCSI login failed due to au...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
: 3.3.4
Assignee: Dan Kenigsberg
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 735726
TreeView+ depends on / blocked
 
Reported: 2011-07-31 15:22 UTC by David Naori
Modified: 2014-07-20 06:11 UTC (History)
9 users (show)

Fixed In Version: v4.9.0-93-ga9e4775
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-09 07:57:41 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)

Description David Naori 2011-07-31 15:22:41 UTC
Description of problem:

When trying to login to a target with bad username and password iscsiadm returns error code 24:

24 - iSCSI login failed due to authorization failure 

vdsm returns error code 464 in any login error:
     class iSCSILoginError(StorageServeriSCSIError):
     code = 464
     message = "Failed to login to iSCSI node"

469         # Finally instruct the iscsi initiator to login to the target
470         cmd = cmdt + ["-l", "-p", portal]
471         rc = misc.execCmd(cmd)[0]
472         if rc != 0:
473             raise se.iSCSILoginError(portal)

vdsm should return more specific exception when login fails due to authorization  error.

Thread-11436::DEBUG::2011-07-31 17:52:33,513::iscsi::373::Storage.Misc.excCmd::(addiSCSIPortal) SUCCESS: <err> = ''; <rc> = 0
Thread-11436::DEBUG::2011-07-31 17:52:33,514::iscsi::471::Storage.Misc.excCmd::(addiSCSINode) '/usr/bin/sudo -n /sbin/iscsiadm -m node -T ERROR5-CHAP -l -p 10.35.64.27:3260' (cwd None)
Thread-11436::DEBUG::2011-07-31 17:52:34,183::iscsi::471::Storage.Misc.excCmd::(addiSCSINode) FAILED: <err> = 'iscsiadm: Could not login to [iface: default, target: ERROR5-CHAP, portal: 10.35.64.27,3260].\niscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure)\niscsiadm: Could not log into all portals\n'; <rc> = 24
Thread-11436::DEBUG::2011-07-31 17:52:34,184::misc::1000::SamplingMethod::(__call__) Trying to enter sampling method (storage.iscsi._getiSCSISessionList)
Thread-11436::DEBUG::2011-07-31 17:52:34,185::misc::1002::SamplingMethod::(__call__) Got in to sampling method
Thread-11436::DEBUG::2011-07-31 17:52:34,185::iscsi::537::Storage.Misc.excCmd::(_getiSCSISessionList) '/usr/bin/sudo -n /sbin/iscsiadm -m session' (cwd None)
Thread-11436::DEBUG::2011-07-31 17:52:34,218::iscsi::537::Storage.Misc.excCmd::(_getiSCSISessionList) SUCCESS: <err> = ''; <rc> = 0
Thread-11436::DEBUG::2011-07-31 17:52:34,219::misc::1010::SamplingMethod::(__call__) Returning last result
Thread-11436::DEBUG::2011-07-31 17:52:34,219::iscsi::604::Storage.iScsi::(checkSessionList) checkSession: dest ['connection: 10.35.64.27', 'iqn: ERROR5-CHAP', 'portal: 0', 'user: ', 'port: 3260']
Thread-11436::DEBUG::2011-07-31 17:52:34,220::iscsi::587::Storage.iScsi::(sameSession) enta key connection v 10.35.64.25 != entb v 10.35.64.27
Thread-11436::DEBUG::2011-07-31 17:52:34,220::iscsi::587::Storage.iScsi::(sameSession) enta key connection v 10.35.64.25 != entb v 10.35.64.27
Thread-11436::DEBUG::2011-07-31 17:52:34,221::iscsi::587::Storage.iScsi::(sameSession) enta key connection v 10.35.64.25 != entb v 10.35.64.27
Thread-11436::DEBUG::2011-07-31 17:52:34,221::iscsi::587::Storage.iScsi::(sameSession) enta key iqn v ERROR4-CHAP != entb v ERROR5-CHAP
Thread-11436::DEBUG::2011-07-31 17:52:34,222::iscsi::511::Storage.Misc.excCmd::(remiSCSINode) '/usr/bin/sudo -n /sbin/iscsiadm -m node -o delete -T ERROR5-CHAP -p 10.35.64.27:3260' (cwd None)
Thread-11436::DEBUG::2011-07-31 17:52:34,569::iscsi::511::Storage.Misc.excCmd::(remiSCSINode) SUCCESS: <err> = ''; <rc> = 0
Thread-11436::ERROR::2011-07-31 17:52:34,570::storage_connection::229::Storage.ServerConnection::(__connectiSCSIServer) Error during storage connection: Failed to login to iSCSI node: ('10.35.64.27:3260',)
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/storage_connection.py", line 223, in __connectiSCSIServer
    con['user'], con['password'])
  File "/usr/share/vdsm/storage/iscsi.py", line 473, in addiSCSINode
    raise se.iSCSILoginError(portal)
iSCSILoginError: Failed to login to iSCSI node: ('10.35.64.27:3260',)
Thread-11436::DEBUG::2011-07-31 17:52:34,570::task::492::TaskManager.Task::(_debug) Task 5abf8266-2052-48d1-af83-a1232f014aba: finished: {'statuslist': [{'status': 464, 'id': '00000000-0000-0000-0000-000000000000'}]}
Thread-11436::DEBUG::2011-07-31 17:52:34,571::task::492::TaskManager.Task::(_debug) Task 5abf8266-2052-48d1-af83-a1232f014aba: moving from state preparing -> state finished
Thread-11436::DEBUG::2011-07-31 17:52:34,571::resourceManager::786::ResourceManager.Owner::(releaseAll) Owner.releaseAll requests {} resources {}
Thread-11436::DEBUG::2011-07-31 17:52:34,572::resourceManager::821::ResourceManager.Owner::(cancelAll) Owner.cancelAll requests {}
Thread-11436::DEBUG::2011-07-31 17:52:34,572::task::492::TaskManager.Task::(_debug) Task 5abf8266-2052-48d1-af83-a1232f014aba: ref 0 aborting False
Thread-11436::INFO::2011-07-31 17:52:34,573::dispatcher::100::Storage.Dispatcher.Protect::(run) Run and protect: connectStorageServer, Return response: {'status': {'message': 'OK', 'code': 0}, 'statuslist': [{'status': 464, 'id': '00000000-0000-0000-0000-000000000000'}]}

Version-Release number of selected component (if applicable):
vdsm-4.9-85.el6.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
vdsm should return more specific exception when login fails due to authorization  error.

Comment 2 Dan Kenigsberg 2011-09-16 21:52:08 UTC
http://gerrit.usersys.redhat.com/772

Comment 3 Daniel Paikov 2011-10-31 10:18:17 UTC
Exists in upstream, but not in official builds. Doesn't exist as late as build 4.9-110.

Comment 4 Federico Simoncelli 2012-06-22 11:02:13 UTC
In the ovirt-3.1 branch as: a9e47753d73a5fe5613f77870ecd4f306df37255

Comment 5 Itamar Heim 2012-08-09 07:57:41 UTC
closing ON_QA bugs as oVirt 3.1 was released:
http://www.ovirt.org/get-ovirt/


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