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.
http://gerrit.usersys.redhat.com/772
Exists in upstream, but not in official builds. Doesn't exist as late as build 4.9-110.
In the ovirt-3.1 branch as: a9e47753d73a5fe5613f77870ecd4f306df37255
closing ON_QA bugs as oVirt 3.1 was released: http://www.ovirt.org/get-ovirt/