Error: "Failed to delete object "Provider VDC NAME" and its dependencies" when deleting a Provider Virtual Data Center
search cancel

Error: "Failed to delete object "Provider VDC NAME" and its dependencies" when deleting a Provider Virtual Data Center

book

Article ID: 397657

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • When deleting a Provider Virtual Data Center (PVDC) it fails with the error below:

    [ ########-####-####-########59cd ] Failed to delete object "PVDC_NAME" and its dependencies.
     - Failed to purge object "PVDC_NAME".
     - could not delete: [com.vmware.vcloud.common.model.storagefabric.StorageClassNameModel#########-####-####-########f835]
     - ERROR: update or delete on table "storage_class" violates foreign key constraint "fk_vm_dis_sto_cl2storage_class" on table "vm_disk_storage_class"
      Detail: Key (id)=(########-####-####-########f835) is still referenced from table "vm_disk_storage_class".

  • The PVDC is deleted from the UI but it becomes stranded and listed in the Stranded Items.
  • In /opt/vmware/vcloud-director/logs/vcloud-contaner-debug.log the below entry is present 

    com.vmware.ssdc.library.exceptions.MultipleLMException: Failed to delete object "PVDC_NAME" and its dependencies. - Multiple Exceptions follow: [com.vmware.vcloud.api.presentation.service.InternalServerErrorException: Failed to purge object "PVDC_NAME".]
    [...]
    Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "storage_class" violates foreign key constraint "fk_vm_dis_sto_cl2storage_class" on table "vm_disk_storage_class"
      Detail: Key (id)=(########-####-####-########f835) is still referenced from table "vm_disk_storage_class".
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
    [...]

Environment

VMware Cloud Director 10.6.0.1

Cause

Stale entries for VMs directly deleted in vCenter are still referencing to the storage class reported in the error.

Resolution

Database modification is needed. Please contact Broadcom Support and note this Article ID (397657) in the problem description. For more information, see Creating and managing Broadcom support cases.