While removing iSCSI connection from a windows server to NetApp E-series storage LUN , the following error was reported.
The session cannot be logged out since a device on that session is currently being used.
The session cannot be logged out since a device on that session is currently being used. The device list showed that LUN0 was still in use. Upon further triage, it was identified that Santricity Storage Manager Agent services was accessing this LUN0 to manage the storage array.
Stopped the Santricity Storage Manager Agent services and the ISCSI connection was terminated successfully. If this doesnt help, then look for similar services that might be holding up the disk.
Hope this helps someone. Please leave a note if it does.