Cleaning duplicate virtual Machine entries in NSX Manager inventory
search cancel

Cleaning duplicate virtual Machine entries in NSX Manager inventory

book

Article ID: 444804

calendar_today

Updated On:

Products

VMware NSX VMware Telco Cloud Platform

Issue/Introduction

  • Multiple duplicate instances of a single virtual machine appear in the NSX Manager inventory.

  • The stale duplicate entries share the exact same External ID (Instance UUID).

  • The VMID associated with the stale VMs obtained using the command vmsvs/getallvms is different.

Environment

NSX 4.1.1.2

TCP 3.0

Cause

  • There is a database inconsistency due to overlapping virtual machine inventory records sharing the same External ID.

  • This locks the stale replica records to orphaned logical ports in the internal NSX database.

Resolution

Note: Ensure a full, image-level backup of the affected virtual machine is completed.

Option 1:

  1.  Forcefully delete the corrupted inventory records via the NSX Management API 

    curl -k -u admin: <password> -X DELETE "https://127.0.0.1/api/v1/fabric/virtual-machines/########################"

  2. Run the following command in NSX Manager to restart the inventory synchronization service and force an immediate polling cycle:

    service cm-inventory restart

  3. Wait for 5 minutes for the polling cycle to complete and verify if the stale VMs are removed from NSX manager. 

Option 2:

  1. Remove the Virtual machine from the Inventory 

    In the vSphere Client, right-click the active virtual machine and select Remove from Inventory. Critical: Do not select "Delete from Disk"

  2. Run the following command in NSX Manager to restart the inventory synchronization service and force an immediate polling cycle:

    service cm-inventory restart

  3. Navigate to Inventory > Virtual Machines in the NSX Manager UI and verify the duplicate entries have been successfully purged.

  4. Return to the vSphere Client, navigate to the datastore containing the virtual machine, right-click the .vmx file, and select Register VM. Power on the virtual machine.

    Note: If the re-registered virtual machine displays its base UUID instead of its friendly name, manually rename the virtual machine in the vSphere Client.

If the stale virtual machine entries persist in the NSX Manager inventory after executing these steps Contact Broadcom support to manually clear the internal database constraints. 

Additional Information

For more information on managing compute manager connections and inventory synchronization, refer to the VMware NSX Documentation.