NSX decommissioning fails due to stale VM attachments reported on segments despite host unpreparation
search cancel

NSX decommissioning fails due to stale VM attachments reported on segments despite host unpreparation

book

Article ID: 452724

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

When attempting to decommission VMware NSX, the NSX Manager UI or API reports that T0s/T1s/segments cannot be deleted because virtual machines (VMs) are still attached. This occurs even when the ESXi hosts have been successfully unprepared and no longer contain any NSX-T configuration or active segment mappings.

Symptoms:

  • NSX Manager prevents segment deletion with errors indicating active virtual wire or logical port attachments.
  • Validation errors such as One or more relationships exist for object or Cannot delete segment as it is in use by a virtual machine.
  • The environment remains in a partially decommissioned state where management components cannot be cleanly removed.

Environment

VMware NSX 4.x

Cause

The issue is caused by stale metadata or "ghost" entries within the NSX Management Plane database. A synchronization mismatch occurs where the Policy or Manager components maintain a record of vNIC attachments (Realized State) that no longer exist on the physical data plane (ESXi hosts). Because the database believes dependencies exist, it blocks the deletion of segments, routers, and transport node configurations.

Resolution

Since the vSphere infrastructure is already decoupled and the end goal is total decommissioning, the management components can be manually removed.

  1. Decommission NSX Management Components:

    1. Log in to the vCenter Server and identify the NSX Manager and NSX Edge virtual machines.
    2. Power off all NSX Manager and Edge VMs.
    3. Delete these VMs from disk.

  2. Use the steps in Removing Orphaned NSX-T Extensions and Networks from vCenter Server  to remove the NSX extension from vCenter.