Use the vCLI command to remove an iSCSI session between an iSCSI adapter and a target.

Prerequisites

Install ESXCLI. See Getting Started with ESXCLI. For troubleshooting, run esxcli commands in the ESXi Shell.

Procedure

  • To remove a session, run the following command:
    esxcli iscsi session remove
    The command takes these options:
    Option Description
    -A|--adapter=str The iSCSI adapter name, for example, vmhba34. This option is required.
    -s|--isid=str The ISID of a session to remove. You can find it by listing all session.
    -n|--name=str The iSCSI target name, for example, iqn.X.

What to do next

Rescan the iSCSI adapter.