Red Hat Bugzilla – Bug 167973
iscsi reload can hang during "iscsi-rescan" if targets are unreachable
Last modified: 2007-11-30 17:07:20 EST
Description of problem:
If any targets are unreachable, and you try an "iscsi reload", the command will
I came up with another simple script that issues the kill session command, and
seems to work ok in the session hangs I found. I'll attach the script and let
you all decide whether you think this is ok to include or not - seems to meet my
needs but you may have issues with including it. Also, for this particular
problem, there may be other more elegant solutions but I thought the simple
script was worth mentioning since it solved my problems.
Note that the README states how to shutdown sessions (see below), but having a
simple utility do it seems worth considering.
Note that any configuration changes will not affect existing target sessions.
For example, removal of a DiscoveryAddress entry from /etc/iscsi.conf
will not cause the removal of sessions to targets discovered through this
DiscoveryAddress, but it will cause the removal of the discovery session
corresponding to the deleted DiscoveryAddress.
To remove these sessions execute the following for each of these sessions:
- Set ConnFailTimeout, ResetTimeout and AbortTimeout on the session to a low
value, like 5 seconds through sysfs by executing the following commands:
echo 5 > /sys/class/scsi_host/host<host_no>/connfail_timeout
echo 5 > /sys/class/scsi_host/host<host_no>/reset_timeout
echo 5 > /sys/class/scsi_host/host<host_no>/abort_timeout
- Stop IOs to all the devices discovered through the session.
- If these devices have been mounted, unmount them.
- Shutdown the session through sysfs by executing the following command:
echo > /sys/class/scsi_host/host<host_no>/shutdown
where <host_no> is the Host Number of the session that has to be removed.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Enter DiscoveryAddress=IP1 into /etc/iscsi.conf
2. /etc/init.d/iscsi start
3. Add DiscoveryAddress=IP2 in /etc/iscsi.conf
4. Somehow make target on IP1 unreachable (pull cable, stop iscsi on target
5. /etc/init.d/iscsi reload *command hang*
"/etc/init.d/iscsi reload" hangs indefinately
"/etc/init.d/iscsi reload" should not hang indefinately
Created attachment 118667 [details]
*** This bug has been marked as a duplicate of 167946 ***
This bug is to add the iscsi-kill-session script created by Netapp to U4. This
is a dulpicate of BZ 167946, but for that BZ we did a fix for the rescan part in
U3. This bug is to get the second part of the fix into U4.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.