Use the vSphere CLI to remove an iSCSI session between an iSCSI adapter and a target.

To remove a session, use esxcli swiscsi session remove. The command takes these options.

d -- The name of your iSCSI adapter, such as vmhbaXX.

t -- The name of the target to log in, such as iqnXX.

s -- The ISID of a session to duplicate, such as session_isid. You can find it by listing all session.

# esxcli swiscsi session remove -t iqn.2001-05.com.equallogic:0-8a0906-cbcde0d02-6a445baadf44ab92-vcli7 -s '00:02:3d:01:00:01'

Rescan the iSCSI adapter.