"You must delete this Organization's Application Port Profiles before you can delete the organization." when deleting an organization in VMware Cloud Director.
search cancel

"You must delete this Organization's Application Port Profiles before you can delete the organization." when deleting an organization in VMware Cloud Director.

book

Article ID: 312277

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Deleting an organization in VMware Cloud Director UI fails with:

com.vmware.vcloud.api.presentation.service.InvalidStateException: You must delete this Organization's Application Port Profiles before you can delete the organization.

  • Edge gateways which were part of the organization were deleted before the associated application port profiles were deleted.

Environment

VMware Cloud Director 10.x

Cause

This is a known issue affecting VMware Cloud Director 10.4.x and 10.5.x versions.

The issue occurs due to the presence of application port profiles which were not deleted before the edge in the organization was deleted.

Resolution

From Cloud Director 10.3 and later versions, the stale application port profiles and this organization containing stale application port profiles can be force deleted via API.

1. Delete an organization with "force" option:

DELETE https://<VCD-ENDPOINT>/api/admin/org/<ORG-UUID>?force=true

2. Synchronize application port profiles:

POST https://<VCD-ENDPOINT>/cloudapi/1.0.0/applicationPortProfiles/sync

Note: POST request requires a filter to be specified. Please refer the OpenAPI documentation.

To retrieve the parameter specific to your environment, follow the steps below:

  1. From API Explorer:


  2. The networkProviderId value to be entered is the ID of the NSXT manager you have integrated with the VCD. You can get this from the VCD UI > Infrastructure Resources > NSX-T Managers > The browser URL will now be populated with a UUID. 



  3. Populate the parameter in the API Explorer in the following format.
    _context==urn:vcloud:nsxtmanager:<NSXT manager ID noted from the browser URL

    Example: _context==urn:vcloud:nsxtmanager:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  4. Execute the API request to sync the profiles.


If utilization of the API is not possible then please open a support request with VMware Technical Support for assistance.

Additional Information

For more information on connecting to VCD via API, refer the article 320526