NSX-V Edge Stranded VM not deleted on vCenter/ESXi
search cancel

NSX-V Edge Stranded VM not deleted on vCenter/ESXi

book

Article ID: 345029

calendar_today

Updated On:

Products

VMware NSX Networking

Issue/Introduction

Symptoms:
  • If the edge VM resides on a disconnected host when it is deleted, the VM is not deleted from vSphere.
  • Attempts to delete Edge VM operation appear to succeed with no errors seen on UI. However these tasks do fail, as can be seen in the NSX manager log 'show log manager': 
2020-07-27 13:15:27.703 GMT+00:00 INFO TaskFrameworkExecutor-19 DeleteEdgeTask:211 - - [nsxv@6876 comp="nsx-manager" subcomp="manager"] Job 'jobdata-248011' - Edge with id 'edge-42' was deleted successfully.

2020-07-27 13:15:27.260 GMT+00:00 ERROR TaskFrameworkExecutor-19 VirtualMachineVcOperationsImpl:269 - - [nsxv@6876 comp="nsx-manager" subcomp="manager"] Failed to destroy VM 'strandedSVM-0'
2020-07-27 13:15:27.285 GMT+00:00 ERROR TaskFrameworkExecutor-19 VcOperationsUtils:359 - - [nsxv@6876 comp="nsx-manager" errorCode="MP10292" subcomp="manager"] Failed to delete vm with index '0' for edge 'edge-42' vmMoid 'vm-1409' vcuuid '500fbef8-70bf-b182-ed9e-c01bfbe1dfe9' com.vmware.vshield.edge.exception.VshieldEdgeException: nested exception is VshieldEdgeException: vShield Edge:10292:Failed to delete VM vm-1409 of NSX Edge edge-42.:Unable to communicate with the remote host, since it is disconnected.
  • The edge VM still exists on vSphere, but is not present on NSX-V inventory.
  • This in turn causes a stranded SVM entry to be created in the NSX manager database.
  • When the initial delete attempt fails, the edge VM is added to a housekeeping task on the NSX manager.
  • The housekeeping task should run for 29 days and attempts deletion twice an hour for any stranded SVM's in the list.
  • However when this process runs for the first time on an edge entry and fails, it incorrectly removes the edge entry from the housekeeping task and no further attempts are made to remove the stranded edge VM from vSphere, which means that edge VM will still reside on vSphere.
  • This can be seen in the NSX manager logs 'show log manager':
2020-07-27 15:50:00.231 GMT+00:00 ERROR TaskFrameworkExecutor-1 VirtualMachineVcOperationsImpl:269 - - [nsxv@6876 comp="nsx-manager" subcomp="manager"] Failed to destroy VM 'strandedSVM-0'
2020-07-27 15:50:00.255 GMT+00:00 INFO TaskFrameworkExecutor-1 StrandedSvmServiceImpl:145 - - [nsxv@6876 comp="nsx-manager" subcomp="manager"] Deleting the Stranded SVM vmId 'vm-1409' instanceUuid '500fbef8-70bf-b182-ed9e-c01bfbe1dfe9' as its past the rentention limit '2592000000'. Created on '1595855727272', cleanupAttempts '0'


Cause

This issue happens because the internal housekeeping task fails.

Resolution

Currently there is no resolution.

Workaround:
Use safe mode flag to delete Edge nodes: ?force=false
DELETE https://NSX-IP/api/4.0/edges/[edge-id]?force=false

If you can't use the safe mode flag for API call,  contact VMware Support and file a Support Request (refer to KB article "How to file a Support Request in Customer Connect" https://kb.vmware.com/s/article/2006985)