Stale vSAN iSCSI target remains listed and cannot be removed from vSAN iSCSI Target Service
search cancel

Stale vSAN iSCSI target remains listed and cannot be removed from vSAN iSCSI Target Service

book

Article ID: 424894

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

Symptoms

A non-functional iSCSI target remains visible when listing vSAN iSCSI targets.

  • The target has no LUNs attached and shows as non-compliant.

  • The target cannot be removed from the vCenter UI or via standard esxcli commands.

Example output showing the stale target:

[root@localhost:~] esxcli vsan iscsi target list
Alias           iSCSI Qualified Name (IQN)                                                                          Interface  Port   Authentication type   LUNs  Is Compliant  UUID                                                                  I/O Owner UUID
-----------     ----------------------------------------------------------------------------------------      ---------     ----     -------------------------   -------  ----------------  ---------------------------------------------------------  --------------------------------------------------------
testalias-2   iqn.1998-01.com.vmware:52c7########41a5-88ed########2330      vmk3       3260  No-Authentication        0     false               a9f55c69-b036-9c27-925b-303e########
DB-1            iqn.2026-01.com.ssf:oracledb-1                                                                    vmk3       3260  No-Authentication        4     true                e8b36069-f2c6-7647-3e3c-303e########  693bc8c8-34b3-7155-9e4c-303e########

  • Removing the stale target via vCenter fails with the following error:

Cannot complete the operation. See the event log for details. Failed to remove an iSCSI target. _RemoveIscsiTarget failed, error is Util: Cannot find target namespace dir for target a9f55c69-b036-9c27-925b-303e########

Environment

VMware vSAN 9.0.0

Cause

The affected iSCSI target (testalias-2) was previously created for testing and later deleted.

Although the target was removed, its associated metadata was not fully cleaned up from the vSAN iSCSI configuration. As a result:

  • A stale iSCSI target entry remains registered in the vSAN configuration.

  • The corresponding target namespace directory no longer exists on the vSAN datastore.

  • vCenter and standard CLI removal operations fail because they rely on this missing namespace directory.

This results in an orphaned iSCSI target object that cannot be managed through supported UI or CLI workflows.

Resolution

Workaround (Manual Cleanup)

Note: This procedure modifies internal vSAN configuration files. Ensure a valid backup is taken before proceeding.

  • SSH to the vSAN master node.

  • Navigate to the vSAN iSCSI configuration directory:

cd /vmfs/volumes/vsanDatastore/.iSCSI-CONFIG/etc/

  • Back up the configuration file:

cp vit.conf vit.conf.backup

  • Edit the configuration file:

vi vit.conf

  • Locate and remove all entries related to the stale iSCSI target:
    • Target definition matching the stale IQN (for example, testalias-2)
    • Any associated auth-group or reference entries
  • Save and exit the editor

(:wq! in vi)

  • Restart the required services to apply the changes:

/etc/init.d/vitd restart

/etc/init.d/vsanmgmtd restart

  • Validate that the stale target no longer appears:
esxcli vsan iscsi target list
 

Additional Information

 

  • This issue is typically observed when iSCSI targets are created and removed during testing or repeated configuration changes.

  • Proper cleanup does not always occur if target deletion fails or is interrupted.

  • If the issue persists or multiple stale entries are present, contact VMware Support before performing further manual cleanup.