[Pkg-iscsi-maintainers] Bug#838540: open-iscsi logout-all.sh script fails to log out iscsi target

Colby Ross colbypr at gmail.com
Thu Sep 22 10:45:34 UTC 2016


Christian

As requested:
# BEGIN RECORD 2.0-873
node.name = iqn.2015-12.org.cokenet.ctl:iscsi
node.tpgt = 1
node.startup = manual
node.leading_login = No
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.gateway = <empty>
iface.subnet_mask = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
iface.state = <empty>
iface.vlan_id = 0
iface.vlan_priority = 0
iface.vlan_state = <empty>
iface.iface_num = 0
iface.mtu = 0
iface.port = 0
iface.bootproto = <empty>
iface.dhcp_alt_client_id_state = <empty>
iface.dhcp_alt_client_id = <empty>
iface.dhcp_dns = <empty>
iface.dhcp_learn_iqn = <empty>
iface.dhcp_req_vendor_id_state = <empty>
iface.dhcp_vendor_id_state = <empty>
iface.dhcp_vendor_id = <empty>
iface.dhcp_slp_da = <empty>
iface.fragmentation = <empty>
iface.gratuitous_arp = <empty>
iface.incoming_forwarding = <empty>
iface.tos_state = <empty>
iface.tos = 0
iface.ttl = 0
iface.delayed_ack = <empty>
iface.tcp_nagle = <empty>
iface.tcp_wsf_state = <empty>
iface.tcp_wsf = 0
iface.tcp_timer_scale = 0
iface.tcp_timestamp = <empty>
iface.redirect = <empty>
iface.def_task_mgmt_timeout = 0
iface.header_digest = <empty>
iface.data_digest = <empty>
iface.immediate_data = <empty>
iface.initial_r2t = <empty>
iface.data_seq_inorder = <empty>
iface.data_pdu_inorder = <empty>
iface.erl = 0
iface.max_receive_data_len = 0
iface.first_burst_len = 0
iface.max_outstanding_r2t = 0
iface.max_burst_len = 0
iface.chap_auth = <empty>
iface.bidi_chap = <empty>
iface.strict_login_compliance = <empty>
iface.discovery_auth = <empty>
iface.discovery_logout = <empty>
node.discovery_address = <empty>
node.discovery_port = 0
node.discovery_type = static
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.nr_sessions = 1
node.session.auth.authmethod = None
node.session.auth.username = <empty>
node.session.auth.password = <empty>
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 172.16.5.30
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD

Colby


On 9/22/2016 05:31, Christian Seiler wrote:
> Hi,
>
> On 09/22/2016 03:06 AM, Colby Ross wrote:
>> So, it appears the command being issued is /bin/iscsiadm -m node
>> --logoutall=all. When I try that command, I get the same error as
>> when I try to run the script. The logout-all.sh script contains this
>> function that invokes that command:> # trivial case
>> if [ -z "$EXCLUDED_SESSIONS" ] ; then
>>          $ISCSIADM -m node --logoutall=all
>>          exit $?
>> fi
>>
>> I don't know scripting language very well at all, but it is
>> apparently not finding the session to terminate correctly. When I
>> manually log out of the session, it reboots and shuts down normally
>> with no issues. Maybe this part of the script is being called in
>> error, I'm not sure. When I replace the command with $ISCSIADM -m
>> node -u, it reboots and shuts down fine, but I consider this more of
>> a hack than a true fix.
> This is weird, I cannot reproduce this here. I logged into a
> new iSCSI session, and after the login I immediately called
>
> iscsiadm -m node --logoutall=all
>
> In that case, the logout worked for me.
>
> (Note that we don't consider return code 21 an error in the
> shutdown logic, because if you just install open-iscsi and
> there are no sessions configured, iscsiadm will also return
> that error code - which is perfectly fine there, as there
> really are no sessions in that case. See the systemd service
> file's SuccessExitStatus line. Doesn't help here though,
> because you clearly have an active session.)
>
> On a running system with the iSCSI session logged in, could
> you post the contents of
>
> iscsiadm -m node -p $PORTAL -T $TARGET -P1
>
> to this bug report?
>
> The command is harmless and will leave the session intact. You
> can run it on a production system. Replace $PORTAL with your
> portal IP and $TARGET with the target, you can find them out by
> using iscsiadm -m node -P1, which is also harmless.
>
> (I don't care about IP addresses or target names, they shouldn't
> be relevant to this, so feel free to censor them.)
>
>> I previously tried to determine the cause of the hang on
>> reboot/shutdown. What happens is the system tries to ping the iscsi
>> target, but fails because the network interface has already been
>> brought down, and the system hangs indefinitely. I get the error
>> connection1:0: ping timeout of 5 secs expired, recv timeout 5, last
>> rx 4294927718, last ping 4294928970, now 4294930224. However, I think
>> the error is just an indication the target was not logged out
>> properly and the system thinks its still connected.
> This is a kind of known issue: if a session is still open and the
> network interface is deconfigured, the system hangs for a long
> time. If a logout wasn't possible, the only proper thing to do
> would actually be to not deconfigure the network interface.
>
> ifupdown already contains such logic when iSCSI is used for the
> root filesystem, because it checks if /etc/iscsi/iscsi.initramfs
> is present and refuses to deconfigure on shutdown if it is. We
> should really make this a lot more dynamical: if there are still
> iSCSI sessions left over after shutdown (for whatever reason),
> we should simply keep the network interface up and running - and
> not just if iSCSI is used in the initramfs. Feel free to open a
> separate bug report for this.
>
> That makes the problem that logout doesn't work in your case so
> much worse, but it isn't the root cause of your problem. The
> output of the iscsiadm command would be helpful for debugging
> this.
>
> Regards,
> Christian



More information about the Pkg-iscsi-maintainers mailing list