Description of problem: Every time i resume from suspend, previous iscsi session I've logged out off, get re-activated. AFAICT, the iscsi initiator saves details of the iSCSI target in /var/lib/iscsi/nodes. Whenever network manager activates an interface (eg resuming from suspend), /etc/init.d/iscsi will login to any targets listed in /var/lib/iscsi/nodes, even if they were *not* logged into previously. eg, [root@t500wlan ~]# iscsiadm -m session iscsiadm: No active sessions. [root@t500wlan ~]# find /var/lib/iscsi/nodes/ /var/lib/iscsi/nodes/ [root@t500wlan ~]# /sbin/iscsiadm --mode discovery --type sendtargets --portal 192.168.254.185:3260,1 192.168.254.185:3260,1 iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 [root@t500wlan ~]# /sbin/iscsiadm --mode node --portal 192.168.254.185:3260,1 --targetname iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 --loginLogging in to [iface: default, target: iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84, portal: 192.168.254.185,3260] Login to [iface: default, target: iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84, portal: 192.168.254.185,3260] successful. [root@t500wlan ~]# find /var/lib/iscsi/nodes/ /var/lib/iscsi/nodes/ /var/lib/iscsi/nodes/iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 /var/lib/iscsi/nodes/iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84/192.168.254.185,3260,1 /var/lib/iscsi/nodes/iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84/192.168.254.185,3260,1/default [root@t500wlan ~]# iscsiadm -m session tcp: [10] 192.168.254.185:3260,1 iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 [root@t500wlan ~]# /sbin/iscsiadm --mode node --portal 192.168.254.185:3260,1 --targetname iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 --logout Logging out of session [sid: 10, target: iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84, portal: 192.168.254.185,3260] Logout of [sid: 10, target: iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84, portal: 192.168.254.185,3260] successful. [root@t500wlan ~]# iscsiadm -m session iscsiadm: No active sessions. [root@t500wlan ~]# /etc/init.d/iscsi start Starting iscsi: [ OK ] [root@t500wlan ~]# iscsiadm -m session tcp: [11] 192.168.254.185:3260,1 iqn.2004-04.com.qnap:ts-439proii:iscsi.berrangehome.bf6d84 It absolutely should *NOT* have activated the session in that last step, since I had explicitly logged out of the iscsi session. Version-Release number of selected component (if applicable): iscsi-initiator-utils-6.2.0.872-7.fc13.x86_64 How reproducible: Always Steps to Reproduce: 1. Login to an iscsi session 2. Logout of the iscsi session 3. /etc/init.d/iscsi start Actual results: It activates sessions that were logged out of Expected results: Logged out sessions, remain logged out. Additional info:
Created attachment 453499 [details] Clearer log of the command sequence to demonstrate problem Bugzilla munged the line endings in the initial description. Attached a clearer copy of the command sequence.
/etc/init.d/iscsi start logs into all portals with the node.startup = automatic. If instead of that script controlling startup, you should mark the startup = manual. If that does not help or what you were looking for, then we need something completely different, because this is just how the tools/daemon/script work. The iscsiadm login/logout command just tells the kernel to login/logout a sessions it does not control the /etc/init.d/iscsi script's startup behavior. And normally if you were to logout a session with iscsiadm then ran /etc/init.d/iscsi start, users expect the node.startup setting to indicate that the session should be logged in (users use the script to log into the sessions instead of running iscsiadm).
Oh yeah, to set the startup you can edit /etc/iscsi/iscsid.conf's node.startup, then rediscover the iscsi portals (when you discover the portals the new iscsid.conf setttings get picked up). Or run iscsiadm to set the node.startup for existing records iscsiadm -m node -o update -n node.startup -v manual
IMHO startup = manual should be the default here. Merely running iSCSI sendtargets should not be causing the host to automatically login to the targets forever after, unless the admin explicitly asked for that behaviour.
(In reply to comment #4) > IMHO startup = manual should be the default here. Merely running iSCSI > sendtargets should not be causing the host to automatically login to the > targets forever after, unless the admin explicitly asked for that behaviour. They do try to login forever though. They login for whatever your initial login retries and timeouts are set at. Also normally users set things up on the target so only the targets that are accessible to the initiator are returned in sendtargets discovery. So every target returned during discovery is one they want to log into (this is why the default for startup is automatic).
(In reply to comment #5) > (In reply to comment #4) > > IMHO startup = manual should be the default here. Merely running iSCSI > > sendtargets should not be causing the host to automatically login to the > > targets forever after, unless the admin explicitly asked for that behaviour. > > They do try to login forever though. They login for whatever your initial login > retries and timeouts are set at. > Ignore that part of the comment above. I thought you meant something different.
In a SOHO environment where people are using something like a Netgear/QNap NAS to provide iSCSI, it is far less likely that the target list will be zoned per client machine. In any case, I've added code to libvirt to force node.startup=manual everytime 'sendtargets' is run to work about this debatable behaviour.
Patch series upstream http://www.redhat.com/archives/libvir-list/2010-November/msg00545.html
Should be available in F15, since we are not backporting to F14 Daniel