Deleting a multi-vc-vm directly from vCenter, deletes the vmdk of the source VM in VMware Cloud Director
search cancel

Deleting a multi-vc-vm directly from vCenter, deletes the vmdk of the source VM in VMware Cloud Director

book

Article ID: 423019

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • This issue occurs when a VM template is stored in vCenter Server A and a VM is deployed to vCenter Server B, where both vCenters share the same storage and the Fast Provisioning (Fast Cross vCenter Instantiation) feature is enabled.

  • With Fast Provisioning enabled, VMware Cloud Director optimizes cross–vCenter instantiation by registering the source VM template from vCenter Server A on vCenter Server B using the shared storage. This registered VM is stored in VMware Cloud Director as a Multi-VC VM and is reused for subsequent instantiations on the same destination vCenter to improve deployment performance.

  • When Fast Cross vCenter Instantiation is used, the Multi-VC VM created during the instantiation shares the same VMX and VMDK files as the original source VM template, which physically reside on the storage associated with vCenter Server A.

    If the Multi-VC VM is deleted directly from disk or from vCenter Server B, the deletion operation also removes the VMX and VMDK files of the original source VM template. This occurs because the Multi-VC VM spans both vCenter Server instances but references the same underlying files as the source template on shared storage.

  • As a result, deleting a Multi-VC VM directly from vCenter or from disk can lead to unintended deletion of the source VM template and data loss.

Environment

VMware Cloud Director 10.x

Cause

This issue is caused as the multi-vc-vm has the same VMDK as the source VM, deleting the multi_vc_vm, also deletes the vmdk for the source vm. Hence deleting this from vCenter is not Ideal.

Resolution

To safely delete Multi-VC VMs, use VMware Cloud Director APIs instead of deleting them directly from vCenter.

Reference: https://developer.broadcom.com/xapis/vmware-cloud-director-openapi/latest/multi-vc-vms/

Step 1: Retrieve Multi-VC VM IDs

  • Use the GET Multi-VC VMs API to list all Multi-VC VMs present in the environment and obtain their IDs

Step 2: Unregister the Multi-VC VM

  • Use the DELETE Multi-VC VM API with the corresponding VM ID.
  • This safely unregisters the Multi-VC VM from the destination vCenter without deleting the shared VMDK or impacting the source VM/template.

Additional Information

Please note: 

  • Do not delete Multi-VC VMs directly from vCenter.
  • VMware Cloud Director API versions are version-sensitive:
    • When using the VCD API Explorer, ensure API version 40.0.0-alpha is selected.
    • When using external API tools such as Postman with VCD 10.5.x, use API version 39.0.0-alpha along with a valid Bearer authentication token.