"Error: Unable to detach resource pool(s)" when attempting to detach a resource pool from a Provider VDC in VMware Cloud Director
search cancel

"Error: Unable to detach resource pool(s)" when attempting to detach a resource pool from a Provider VDC in VMware Cloud Director

book

Article ID: 430489

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

When attempting to detach a resource pool from a Provider VDC (PVDC) in VMware Cloud Director (VCD), the operation fails despite the resource pool being unused.

Error observed:

[ ########-####-####-####-############ ] Unable to detach resource pool(s) 'moref:// ########-####-####-####-############/ResourcePool#resgroup-######' because storage policies would no longer be supported. Here are the first 1 (out of 1 storage policies) which would become unsupported: Storage-Policy

 

Environment

VMware Cloud Director 10.6.1

Cause

A resource pool cannot be detached if it serves as the backing hardware for a Storage Policy that is still published to the PVDC or its child Organization VDCs (Org VDCs).

Resolution

To resolve the issue, the dependencies must be removed in the correct top-down order (Org VDC -> PVDC -> Resource Pool)

1. Identify the linked Org VDCs:

1.1 Run the below SQL query in the VCD database to identify exactly which Org VDC(s) the storage policy is published to.

  • SELECT 
        sc.id, 
        sc.name AS StoragePolicyName, 
        vlr.vdc_id AS OrgVDC_ID, 
        opv.name AS ORGVDC_NAME 
    FROM storage_class sc
    INNER JOIN vdc_logical_resource vlr ON sc.id = vlr.fo_id 
    INNER JOIN org_prov_vdc opv ON vlr.vdc_id = opv.id 
    WHERE sc.name = 'storage policy name';

2. Identify any VMs that are currently using this storage policy:

  • SELECT 
        sc.id, 
        sc.name AS StoragePolicyName, 
        vm.name AS VM_NAME 
    FROM storage_class sc
    INNER JOIN vm ON sc.id = vm.sclass_id 
    WHERE sc.name = 'STORAGE POLICY';

3. Remove the unused storage policy from the Org VDC:

  • From the primary left navigation panel, select Resources, and from the page top navigation bar, select Cloud Resources.
  • From the secondary left panel, select Organization VDCs, and click the name of the target organization virtual data center.

  • Under Policies, select Storage.

  • Click the radio button next to the name of the target storage policy, and click Remove.

  • To confirm, click Remove.

4. Remove from PVDC: Once cleared from all child Org VDCs, navigate to the Provider VDC -> Storage Policies and remove the Storage Policy.

5. Detach Resource Pool: Navigate to the Provider VDC -> Resource Pools and successfully detach the Resource Pool.