Attempts to remove a Cloud Zone from a project results in the error message similar to Cannot delete with active resources: ###
search cancel

Attempts to remove a Cloud Zone from a project results in the error message similar to Cannot delete with active resources: ###

book

Article ID: 312223

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Identify resources linked within a Cloud Zone, in a project, and how to delete the deployments to dissociate the cloud zone from the project.


Symptoms:
  1. Unable to dissociate a cloud zone from a project.
  2. The resource exists inside the cloud zone linked with a project, but you are unable to identify it from the extensive list of deployments in Cloud Assembly.


Environment

VMware vRealize Automation 8.x

Cause

When there are large-scale deployments under vRA it may be difficult to identify the resources in a cloud zone
from the Cloud Assembly UI.

Resolution

Note: You may use Postman to run the API calls against vRA. The procedure and method is detailed in the following blog vRealize Automation Cloud Assembly's IaaS API - VMware Cloud Management
  • First, annotate the IDs of each cloud zone and project using the below API calls.
  1. Obtaining the Project ID

  • API Method: GET
  • API: https://vRAApplianceFQDN/iaas/api/projects?$filter=name%20eq%20'ProjectName'

Example API:

https://vra_fqdn/iaas/api/projects?$filter=name%20eq%20'test-project'

Response

{ ...
"name": "test-project",
"description": "",
"id": "<UUID_1>",
"organizationId": "<UUID_2>",
           ... }

Note: The italicized value is the ID of our project test-project.

  1. Obtaining Cloud Zone ID

  • API Method: GET
  • API: https://vRAApplianceFQDN/iaas/api/zones?$filter=name%20eq%20'CloudZoneName'

Example

https://vra_fqdn/iaas/api/zones?$filter=name%20eq%20'Autolab VC / Autolab'

Response

{ ...
"name": "Autolab VC / Autolab",
"id": "<UUID_3>",
"updatedAt": "2022-08-19",
...}

Note: The italicized value is the ID of our cloud zone Autolab VC / Autolab.

  1. Utilize an internal API call to retrieve the list of resources that are part of the project and the cloud zoneObtain the Resource Names

  • API Method: GET
  • API
    https://vra_fqdn/provisioning/uerp/provisioning/mgmt/compute?$filter=customProperties.__groupResourcePlacementLink%20eq%20 '/provisioning/resources/group-placements/GroupPlacementID'

Note: Group Placement ID is in the format ProjectID-CloudZoneID

<UUID_1>-<UUID_3>

Example API

https://vra_fqdn/provisioning/uerp/provisioning/mgmt/compute?$filter=customProperties.__groupResourcePlacementLink%20eq%20 '/provisioning/resources/group-placements/<UUID_1>-<UUID_3>'

Response

{ ...
"hostName": "UbuntuTest",
"isPublished": true,
"id": "<UUID_4>",
 "name": "Cloud_vSphere_Machine_117",
....}

Note: Repeat for all the Resource names identified from Step # 3. These should be searched and deleted from the deployments before attempting to dissociate the cloud zone from the project.
Note: Date, time, and environmental variables may vary depending on your environment.


Additional Information

Impact/Risks:

When a deployment is deleted from vRA, all VMs and resources associated with that deployment are destroyed.