Error: "The VMware Cloud Director entity <catalog_name> already exists" when attempting to recreate a Catalog which was previously deleted
search cancel

Error: "The VMware Cloud Director entity <catalog_name> already exists" when attempting to recreate a Catalog which was previously deleted

book

Article ID: 387639

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Creating a Catalog in the Cloud Director Tenant portal fails with an error of the form:

The VMware Cloud Director entity <catalog_name> already exists

  • The new Catalog name is the same as one which was previously deleted and is no longer visible in the Cloud Director Tenant portal under Content Hub > Catalogs.
  • The task to delete the old Catalog with this name failed, but the Catalog was removed from the Cloud Director Tenant portal.

Environment

VMware Cloud Director

Cause

This issue can occur if a Catalog deletion task did not fully complete.
The old Catalog still exists in Cloud Director but in a state such that the Cloud Director UI will not display it.
Catalog names in Cloud Director must be unique within an Organization.

Resolution

To resolve this issue the old Catalog can be retrieved and deleted using the Cloud Director API.
After the old Catalog is removed a new Catalog with the same name can be created in the same Organization.

WARNING: Ensure the Catalog is empty of Catalog items before deleting it as all child entities such as vApp Templates and Media will be deleted with the Catalog

  1. Log in to the Cloud Director Provider portal as a System Administrator.
  2. Open Resources > Cloud Resources > Organizations and click the name of the Organization in which the Catalog creation is being attempted.
  3. From the browser URL, copy the ID of the Organization.

    Example URL:
    https://<vcd_address>/provider/cloud/organizations/urn:vcloud:org:########-####-####-####-########01ab/configure/general

    Organization ID:
    ########-####-####-####-########01ab

  4. If using API, follow the below steps:

  5. Copy the Catalog ID from the output (step 5):

    For example:
    ########-####-####-####-########23cd

  6. Log in to the Cloud Director API as a System Administrator, How to establish an API connection VMware Cloud Director.
  7. Using the Cloud Director API, retrieve the details of the old Catalog which is to be deleted using the Catalog ID from step 6:

    Request:
    GET https://<vcd_address>/api/admin/catalog/<catalog_id>

    Request Headers:
    Accept: application/*+json;version=<vcd_api_version>
    Authorization: Bearer <vcd_auth_token>

    For example:
    GET https://<vcd_address>/api/admin/catalog/########-####-####-####-########23cd

  8. Review the JSON result and confirm the old Catalog to be deleted is returned and the details of any Catalog Items contained within it.
  9. After confirming that this old Catalog can be deleted along with any remaining Catalog Items, use the Cloud Director API to delete it:

    Request:
    DELETE https://<vcd_address>/api/admin/catalog/<catalog_id>

    Request Headers:
    Accept: application/*+json;version=<vcd_api_version>
    Authorization: Bearer <vcd_auth_token>

    For example:
    DELETE https://<vcd_address>/api/admin/catalog/########-####-####-####-########23cd

  10. Verify that the old Catalog has now been deleted, for example by viewing the task in the Organization in the Cloud Director UI and confirming it has succeeded.
  11. Create the new Catalog with the same name in the same Organization as per the documentation, Create a Catalog in the VMware Cloud Director Tenant Portal.

Additional Information

For information on using database edits to perform these actions, please contact Broadcom support and reference this KB article.