Bug 981320

Summary: iscsiadm: is duplicating iSCSI sessions after reboot
Product: Red Hat Enterprise Linux 7 Reporter: Bruno Goncalves <bgoncalv>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED CURRENTRELEASE QA Contact: Bruno Goncalves <bgoncalv>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: agrover, bgoncalv, cleech, qcai
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iscsi-initiator-utils-6.2.0.873-11.el7 Doc Type: Bug Fix
Doc Text:
Cause: NetworkManager event script was restarting the iscsi.service to start sessions configured for automatic startup when new network interfaces came online. But restart was actually tearing down and recreating already active sessions, and races would occur when multiple network interfaces came online in a short period of time, resulting in multiple sessions for a single target configuration. Consequence: Multiple iSCSI session to the same target portal via a single interface were sometimes created. Fix: The NetworkManager event script was changes to use a new reload target of the iscsi.service, which will make attempt to being up sessions that don't exists but will not tear down existing sessions. Result: iSCSI sessions configured for automatic startup should become active once the network is ready, without duplicate sessions.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:39:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bruno Goncalves 2013-07-04 13:05:43 UTC
Description of problem:
After rebooting the iSCSI sessions gets duplicated

Version-Release number of selected component (if applicable):
iscsi-initiator-utils-6.2.0.873-7.el7.x86_64 

3.10.0-0.rc7.64.el7.x86_64


How reproducible:
Often (it does not happens always, but most of the time)

Steps to Reproduce:
1.Connect to iSCSI target
iscsiadm -m discovery -I default -p na3170b.lab.bos.redhat.com -t st
10.16.41.222:3260,1 iqn.1992-08.com.netapp:sn.151753773
10.16.43.127:3260,1 iqn.1992-08.com.netapp:sn.151753773

iscsiadm -m node -l
Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] (multiple)
Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] (multiple)
Login to [iface: default, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.41.222,3260] successful.
Login to [iface: default, target: iqn.1992-08.com.netapp:sn.151753773, portal: 10.16.43.127,3260] successful.

2.There will be 2 sessions (IDs 1 and 2)
3.Rebbot the server

4. Check sessions after reboot
There are 4 sessions.

iscsiadm -m session -P1
Target: iqn.1992-08.com.netapp:sn.151753773
	Current Portal: 10.16.41.222:3260,1
	Persistent Portal: 10.16.41.222:3260,1
		**********
		Interface:
		**********
		Iface Name: default
		Iface Transport: tcp
		Iface Initiatorname: iqn.1994-05.com.redhat:os-reboot
		Iface IPaddress: 10.16.45.84
		Iface HWaddress: <empty>
		Iface Netdev: <empty>
		SID: 1
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE

		**********
		Interface:
		**********
		Iface Name: default
		Iface Transport: tcp
		Iface Initiatorname: iqn.1994-05.com.redhat:os-reboot
		Iface IPaddress: 10.16.45.84
		Iface HWaddress: <empty>
		Iface Netdev: <empty>
		SID: 3
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE
	Current Portal: 10.16.43.127:3260,1
	Persistent Portal: 10.16.43.127:3260,1
		**********
		Interface:
		**********
		Iface Name: default
		Iface Transport: tcp
		Iface Initiatorname: iqn.1994-05.com.redhat:os-reboot
		Iface IPaddress: 10.16.45.84
		Iface HWaddress: <empty>
		Iface Netdev: <empty>
		SID: 2
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE

		**********
		Interface:
		**********
		Iface Name: default
		Iface Transport: tcp
		Iface Initiatorname: iqn.1994-05.com.redhat:os-reboot
		Iface IPaddress: 10.16.45.84
		Iface HWaddress: <empty>
		Iface Netdev: <empty>
		SID: 4
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE

Actual results:
4 sessions are displayed

Expected results:
The same sessions that existed when server rebooted (2)

Comment 3 Bruno Goncalves 2013-09-04 15:19:06 UTC
Verified the fix on iscsi-initiator-utils-6.2.0.873-13.el7.x86_64

Comment 4 Ludek Smid 2014-06-13 10:39:44 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.