Error "Organization vDC compute policy is being used by VMs. Before deleting, remove all VMs from this policy" thrown when trying to delete Provider VDC
search cancel

Error "Organization vDC compute policy is being used by VMs. Before deleting, remove all VMs from this policy" thrown when trying to delete Provider VDC

book

Article ID: 373060

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Error about VMs using vGPU profile, when trying to delete PvDC with OvDC and vGPU profile
  • The Provider VDC was removed from the vGPU profile scope
  • The following error is displayed when attempting to remove the Provider VDC:

    Internal Server Error
     - could not delete: [com.vmware.vcloud.common.model.vdc.ProviderVdcModel#xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]
     - ERROR: update or delete on table "vdc_compute_policy" violates foreign key constraint "fk_vapp_vm2vdc_comp_poli" on table "vapp_vm"
      Detail: Key (id)=(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) is still referenced from table "vapp_vm".

Environment

VMware Cloud Director 10.5.1.1

Cause

This is a known issue in Cloud Director 

The issue occurs only when you create a compute policy that is associated to a PVDC and then add further PVDCs in later time.

The vdc_compute_policy table shows the pvdc_id as the value of the original PVDC which should be set to NULL and causing the problem.

Resolution

To resolve this issue, please open a Support Request with VMware Technical Support and reference this article.
Database modifications may be required to resolve this issue and will require VMware Technical Support assistance.