Source vApp template is deleted when removing a failed copy of the vApp template in VMware Cloud Director
search cancel

Source vApp template is deleted when removing a failed copy of the vApp template in VMware Cloud Director

book

Article ID: 440537

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • When a vApp template copy or move operation fails in VMware Cloud Director, attempting to delete the failed copy at the destination triggers an unintended deletion of the source template, resulting in data loss.

  • This issue can be verified when attempting to copy or move a template from one catalog to another. When the operation fails, deleting the failed copy from the destination catalog incorrectly removes the source vApp template along with its underlying VM in vCenter.

  • The /opt/vmware/vcloud-director/logs/vcloud-container-debug.log displays the following error:

    yyyy-mm-dd hh:mm:ss| ERROR | Backend-activity-pool-<REDACTED_SECRETS> | CopyContentsActivity | [Activity Execution] Uncaught Exception during Activity execution. Recent phase: com.vmware.vcloud.vdc.impl.CopyContentsActivity$CopyContentsPhase...
    java.util.concurrent.ExecutionException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
     at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:136)
     ...
    Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
     at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
     at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
     ...
     at com.vmware.vcloud.fabric.storage.storedVm.impl.HibernateStoredVmDao.findByValRef(HibernateStoredVmDao.java:79)
     at com.vmware.vcloud.fabric.storage.placement.impl.LinkedClonePlacementUtil.findAllLinkedCloneSourceVms(LinkedClonePlacementUtil.java:90)
     at com.vmware.vcloud.fabric.storage.placement.impl.FPVirtualMachineStorageSelectorImpl.getPlacementParams(FPVirtualMachineStorageSelectorImpl.java:191)
     at com.vmware.vcloud.fabric.storage.placement.impl.FPVirtualMachineStorageSelectorImpl.selectStorageContainer(FPVirtualMachineStorageSelectorImpl.java:106)

Environment

VMware Cloud Director 10.6

Cause

The issue is specifically tied to environments where Fast Provisioning is enabled. When VCD attempts to locate source VMs for linked clones, duplicate entries cause the task to crash or behave incorrectly during cleanup, leading to the deletion of the wrong entity.

Resolution

Broadcom is aware of this issue and a fix is planned for an upcoming release of VMware Cloud Director.

Please subscribe to this KB by following the steps in the article: Subscribe an article for future updates on the resolution.