Removal of iSCSI discovery sendtarget address fails on ESXi with active session error
search cancel

Removal of iSCSI discovery sendtarget address fails on ESXi with active session error

book

Article ID: 319790

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

When there are active sessions on the targets discovered by an iSCSI discovery sendtarget address, you see these symptoms:

  • The iSCSI discovery sendtarget address remove operation fails.

  • You see this error similar to: 

    Symptoms

    Cannot remove discovery address as there are active sessions on the targets discovered by this address.




Environment

  • VMware vSphere ESXi 7.x
  • VMware vSphere ESXi 8.x
  • VMware vSphere ESXi 9.x

Cause

ESXi prevents the removal of a discovery address if active TCP sessions exist between the host and the storage target. Additionally, when migrating an iSCSI VMkernel adapter to a DVS set for MTU 9000, the adapter may retain its original MTU 1500 setting, causing a mismatch that prevents session teardown.

Resolution

To resolve this issue, manually terminate the active sessions before removing the discovery address.

  1. List the active iSCSI sessions: esxcli iscsi session list

  2. Identify the Target Name (IQN) and Adapter from the list.

  3. Remove the specific session: esxcli iscsi session remove --name=<target_name> --adapter=<adapter_name>

  4. Alternatively, use the force flag to remove the discovery address and its associated sessions: esxcli iscsi adapter discovery sendtarget remove --adapter=<adapter_name> --address=<IP_address:port> --force


For GUI method. 

Please ensure that the following steps have been taken to unmount and detach any datastores. - Detach a LUN device from ESXi hosts

Note :

Target Removal: When removing a static iSCSI target that was populated via dynamic discovery, you must remove the dynamic target before performing a storage rescan. If you do not remove the dynamic target first, the host will automatically rediscover it and re-add it to the list of static targets during the rescan.

MTU Configuration: Ensure that Jumbo Frames (MTU 9000) are consistently configured end-to-end across the entire storage data path. This includes the vSwitch/DVS, physical network switches, and the storage array.

  • To remove the iSCSI targets go to:

Host -> Configure -> Storage Adapters -> vmhba -> Static Discovery.

Select the iSCSI targets then click "remove"

If the target was discovered using Dynamic Discovery then switch to the Dynamic Discovery tab.

Select the Dynamic Discovery target and click remove. 

 

Now since the static target has been removed and the session have been closed and the dynamic target has been removed, now you can rescan the adapter to update the changes.

 

 

 

Additional Information

For additional information:

How to remove iSCSI targets on ESXi
Host Profile Remediation Fails with iSCSI Session Errors


To speak with a customer representative or a Support Engineer see Contact Support