Remove Stale/duplicate NSX Segments from vCenter Network Inventory
search cancel

Remove Stale/duplicate NSX Segments from vCenter Network Inventory

book

Article ID: 369037

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • NSX Segment is showing under the vCenter Network Inventory
  • Port groups shown in vCenter are not present on the ESXi hosts, verified with 'esxcfg-vswitch -l'
  • NSX Managers may have already been deleted.  If not, confirm the following: 
    • Validated NSX Segment is unable to be found from within the NSX UI
    • Validated the NSX Segment is not showing up when running the following API Call - "GET https://nsxManager_Ip/api/v1/logical-ports".

Environment

  • VMware NSX-T Datacenter
  • VMware NSX
  • VMware vCenter Server

Cause

NSX Managers may have been improperly deleted before required removal of NSX Segments had been completed

Resolution

If it is confirmed that the NSX Segment is stale in the vCenter Network Inventory, proceed with the following steps:

Note: It is advised to take a backup of the vCenter before proceeding with the following steps:

  1. Identify the dvs-id by selecting the DVS in which the segment is a part of and view the ID from the Browser URL. You should see text in a format similar to the following:

    dvs-######:164#####-c####-4####-a###-ad#########/summary

    The dvs-id value to use is the portion before the :, i.e. dvs-######

  2. Identify the dvportgroup-id by selecting the stale NSX segment from the vCenter network inventory and grabbing the ID from the browser URL. You should see text in a format similar to the following:

    dvportgroup-######:16######-c####-4####-a####-ad########/summary

    The dvportgroup-id value to use is the portion before the :, i.e. dvportgroup-######

  3. Login to vCenter Server MOB by going to the following URL:

    https://vCenter_FQDN/mob/?moid=dvs-######&method=removeNsxPortgroups

    Note: Rplace dvs-###### with the dvs-id value noted in Step 1.

  4. Copy and paste the following snippet into the parameters field to remove the specific dvportgroup-id:

    <portgroupKey>dvportgroup-######</portgroupKey>

    Note: Replace dvportgroup-###### with the dvportgroup-id value noted in Step 2.


  5. Click the Invoke Method link.

Note: There is no impact on the vCenter when running these MOB commands. No vCenter or NSX restarts are required as a result. 

 

Example Screenshots:

dvs-id:

dvportgroup-id: