Package: open-iscsi
Version: 2.0.873+git1.4c1f2d90-2
I am running debian stretch/sid with virt-manager, dkms, open-iscsi,
virtualbox guest additions, and openssh installed.
I have an iscsi session opened with a local box on my lan, running
FreeNAS. I have virt-manager and its dependencies installed, and have
connected to the iSCSI share with virt-manager. I have no issues
connecting, and no issues starting the machine back up. The issue comes
during reboot or shutdown.
It looks like the script to log out all sessions (logout-all.sh) is
being called at reboot/shutdown, but it is not finding any sessions to
disconnect from, even though when I issue iscsiadm -m session, I get
this output:
root@debscsi:~# iscsiadm -m session
tcp: [1] 172.16.5.30:3260,257 iqn.2015-12.org.cokenet.ctl:iscsi (non-flash)
root@debscsi:~#
The session is still connected, and I can access it. When I manually
invoke logout-all.sh, I get this:
root@debscsi:/lib/open-iscsi# ./logout-all.sh
iscsiadm: No matching sessions found
root@debscsi:/lib/open-iscsi#
When I try to debug the script with bash -x, I get the following output:
root@debscsi:/lib/open-iscsi# bash -x logout-all.sh
+ ISCSIADM=/sbin/iscsiadm
+ PIDFILE=/run/iscsid.pid
+ ISCSI_ROOT_KEEP_ALL_SESSIONS_AT_SHUTDOWN=0
+ '[' -f /etc/default/open-iscsi ']'
+ . /etc/default/open-iscsi
++ LVMGROUPS=
++ HANDLE_NETDEV=1
++ EXCLUDE_MOUNTS_AT_SHUTDOWN=
++ ISCSI_ROOT_KEEP_ALL_SESSIONS_AT_SHUTDOWN=0
+ '[' -f /etc/iscsi/iscsi.initramfs ']'
+ '[' '!' -s /run/iscsid.pid ']'
++ sed -n 1p /run/iscsid.pid
+ kill -0 1703
+ EXCLUDED_SESSIONS=
+ '[' -f /run/open-iscsi/shutdown-keep-sessions ']'
+ '[' -z '' ']'
+ /sbin/iscsiadm -m node --logoutall=all
iscsiadm: No matching sessions found
+ exit 21
root@debscsi:/lib/open-iscsi#
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.
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.
I previously reported this under the systemd package, as I thought it
was an issue with systemd and its ordering of shutdown scripts (possibly
killing the interface before the logout of iscsi session). That was
reported in bug# 838028 and I have updated this bug to reflect my
additional troubleshooting and findings. Any help with the appropriate
fix for this would be appreciated.
Colby Ross