Deleting Segment from Global Manager Fails with Error: deleteInfraSegmentPort is invalid on the global manager (500518)
search cancel

Deleting Segment from Global Manager Fails with Error: deleteInfraSegmentPort is invalid on the global manager (500518)

book

Article ID: 426307

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

In a federated NSX environment, attempts to remove a Global Segment may fail due to existing virtual machines connected to the segment in a Local Manager. When this occurs, the deletion request is rejected by the Global Manager and returns the following error:

Error: The API deleteInfraSegmentPort is invalid on the global manager. (Error code: 500518)

Cause

VM connections are managed by Local Managers. If a Global Segment still has VMs connected at another site, the Global Manager considers it in use and blocks deletion.

Resolution

  1. Review all Local Managers to confirm whether any virtual machines are still attached to the Global Segment.

    To verify whether a Global Segment still has VM attachments at a specific site, the following Local Manager API can be used:

    curl -k -u '<user>' -X GET \ "https://<local-manager>/policy/api/v1/global-infra/segments/<SEGMENT-UUID>/ports"
     
    Sample output:

    {
      "results" : [ ],
      "result_count" : 0,
      "sort_by" : "display_name",
      "sort_ascending" : true
    }

    If segment ports are returned, virtual machines are still connected to the Global Segment at that site, which prevents deletion from the Global Manager.

  2. From the affected site, detach or migrate the virtual machines to another segment.
  3. Retry deleting the Global Segment from the Global Manager after all VM attachments have been removed.

 

Additional Information

See: Scripted cleanup of stale logical ports on NSX segments if there are no VMs connected to the segment but it still shows ports are in use.