Hi Lee,
Thanks for adding the async login support to upstream. I've ran some tests using the iscsiadm built from there
and would like to ask:
1. How is it possible to gather the async logins return status? if understood correctly, the proposed way
is to lookup for the connections in the output of "iscsiadm -m session" after the async logins were launched.
Currently, I am using a sampling loop, checking at 1 second intervals the output of iscsiadm -m session for
presence of expected connections targets and portals and breaks if all were found or not found within
the expected timeout interval, which for the default iscsi settings is considered as following:
(120 seconds timeout per connection login) * (number of connections) / (number of workers)
Is there a better way? I am not sure how to gather the error status when a connection not able to login in such case.
2. Would it also be supported for non-login-all mode? For "iscsiadm -m node -T target -p portal -I interface --login"
I get same timeouts with/without the --no-wait flag, meaning the test waits 240 seconds in case two connections
are down when using a single node login worker for both cases, so I assume it currently doesn't apply for this login mode.
-- Simulating one portal down (2 connections down) with one worker, using node login without --no-wait
# python3 ./initiator.py -j 1 -i 10.35.18.220 10.35.18.156 -d 10.35.18.156
2020-08-18 15:59:01,874 INFO (MainThread) Removing prior sessions and nodes
2020-08-18 15:59:01,882 INFO (MainThread) Deleting all nodes
2020-08-18 15:59:01,893 INFO (MainThread) No active sessions
2020-08-18 15:59:01,943 INFO (MainThread) Setting 10.35.18.156 as invalid address for target iqn.2003-01.org.vm-18-220.iqn2
2020-08-18 15:59:01,943 INFO (MainThread) Setting 10.35.18.156 as invalid address for target iqn.2003-01.org.vm-18-220.iqn1
2020-08-18 15:59:01,943 INFO (MainThread) Discovered connections: {('iqn.2003-01.org.vm-18-220.iqn1', '
0.0.0.0:0,0'), ('iqn.2003-01.org.vm-18-220.iqn2', '
0.0.0.0:0,0'), ('iqn.2003-01.org.vm-18-220.iqn2', '
10.35.18.220:3260,1'), ('iqn.2003-01.org.vm-18-220.iqn1', '
10.35.18.220:3260,1')}
2020-08-18 15:59:01,944 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn1 portal
0.0.0.0:0,0
2020-08-18 15:59:01,956 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn2 portal
0.0.0.0:0,0
2020-08-18 15:59:01,968 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn2 portal
10.35.18.220:3260,1
2020-08-18 15:59:01,980 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn1 portal
10.35.18.220:3260,1
2020-08-18 15:59:01,995 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn1 portal
0.0.0.0:0,0 (nowait=False)
2020-08-18 16:01:02,019 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn2 portal
0.0.0.0:0,0 (nowait=False)
2020-08-18 16:01:02,028 ERROR (MainThread) Job failed: Command ['iscsiadm', '--mode', 'node', '--targetname', 'iqn.2003-01.org.vm-18-220.iqn1', '--interface', 'default', '--portal', '
0.0.0.0:0,0', '--login'] failed rc=8 out='Logging in to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn1, portal: 0.0.0.0,0]' err='iscsiadm: Could not login to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn1, portal: 0.0.0.0,0].\niscsiadm: initiator reported error (8 - connection timed out)\niscsiadm: Could not log into all portals'
2020-08-18 16:03:02,045 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn2 portal
10.35.18.220:3260,1 (nowait=False)
2020-08-18 16:03:02,053 ERROR (MainThread) Job failed: Command ['iscsiadm', '--mode', 'node', '--targetname', 'iqn.2003-01.org.vm-18-220.iqn2', '--interface', 'default', '--portal', '
0.0.0.0:0,0', '--login'] failed rc=8 out='Logging in to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn2, portal: 0.0.0.0,0]' err='iscsiadm: Could not login to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn2, portal: 0.0.0.0,0].\niscsiadm: initiator reported error (8 - connection timed out)\niscsiadm: Could not log into all portals'
2020-08-18 16:03:02,321 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn1 portal
10.35.18.220:3260,1 (nowait=False)
2020-08-18 16:03:02,695 INFO (MainThread) Connecting completed in 240.752s
-- Simulating one portal down (2 connections down) with one worker, using node login with --no-wait
# python3 ./initiator.py -j 1 -i 10.35.18.220 10.35.18.156 -d 10.35.18.156 --nowait
2020-08-18 16:16:05,802 INFO (MainThread) Removing prior sessions and nodes
2020-08-18 16:16:06,075 INFO (MainThread) Deleting all nodes
2020-08-18 16:16:06,090 INFO (MainThread) No active sessions
2020-08-18 16:16:06,130 INFO (MainThread) Setting 10.35.18.156 as invalid address for target iqn.2003-01.org.vm-18-220.iqn2
2020-08-18 16:16:06,131 INFO (MainThread) Setting 10.35.18.156 as invalid address for target iqn.2003-01.org.vm-18-220.iqn1
2020-08-18 16:16:06,131 INFO (MainThread) Discovered connections: {('iqn.2003-01.org.vm-18-220.iqn2', '
10.35.18.220:3260,1'), ('iqn.2003-01.org.vm-18-220.iqn1', '
0.0.0.0:0,0'), ('iqn.2003-01.org.vm-18-220.iqn1', '
10.35.18.220:3260,1'), ('iqn.2003-01.org.vm-18-220.iqn2', '
0.0.0.0:0,0')}
2020-08-18 16:16:06,132 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn2 portal
10.35.18.220:3260,1
2020-08-18 16:16:06,147 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn1 portal
0.0.0.0:0,0
2020-08-18 16:16:06,162 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn1 portal
10.35.18.220:3260,1
2020-08-18 16:16:06,176 INFO (MainThread) Adding node for target iqn.2003-01.org.vm-18-220.iqn2 portal
0.0.0.0:0,0
2020-08-18 16:16:06,190 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn2 portal
10.35.18.220:3260,1 (nowait=True)
2020-08-18 16:16:06,324 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn1 portal
0.0.0.0:0,0 (nowait=True)
2020-08-18 16:18:06,351 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn1 portal
10.35.18.220:3260,1 (nowait=True)
2020-08-18 16:18:06,356 ERROR (MainThread) Job failed: Command ['iscsiadm', '--mode', 'node', '--targetname', 'iqn.2003-01.org.vm-18-220.iqn1', '--interface', 'default', '--portal', '
0.0.0.0:0,0', '--login', '--no_wait'] failed rc=8 out='Logging in to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn1, portal: 0.0.0.0,0]' err='iscsiadm: Could not login to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn1, portal: 0.0.0.0,0].\niscsiadm: initiator reported error (8 - connection timed out)\niscsiadm: Could not log into all portals'
2020-08-18 16:18:06,589 INFO (login_0) Login to target iqn.2003-01.org.vm-18-220.iqn2 portal
0.0.0.0:0,0 (nowait=True)
2020-08-18 16:20:06,643 ERROR (MainThread) Job failed: Command ['iscsiadm', '--mode', 'node', '--targetname', 'iqn.2003-01.org.vm-18-220.iqn2', '--interface', 'default', '--portal', '
0.0.0.0:0,0', '--login', '--no_wait'] failed rc=8 out='Logging in to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn2, portal: 0.0.0.0,0]' err='iscsiadm: Could not login to [iface: default, target: iqn.2003-01.org.vm-18-220.iqn2, portal: 0.0.0.0,0].\niscsiadm: initiator reported error (8 - connection timed out)\niscsiadm: Could not log into all portals'
2020-08-18 16:20:06,656 INFO (MainThread) Connecting completed in 240.524s
Thanks for helping out,
Amit