Replication Tracking VMs are not deleted from VCD and vCenter when VM replications are deleted from VMware Cloud Director Availability
search cancel

Replication Tracking VMs are not deleted from VCD and vCenter when VM replications are deleted from VMware Cloud Director Availability

book

Article ID: 384376

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Delete VM replication from VMware Cloud Director Availability (VCDA), however corresponding RT(Replication Tracking) VM references are not deleted from vCenter.
  • VMware Cloud Director (VCD) detects references to these RT VMs, which in turn leads to the allocation and consumption of storage resources.

Environment

VMware Cloud Director Availability
VMware Cloud Director

Cause

Upon recovery, the RT VM is converted into a standard VM, preventing its automatic cleanup. Notably, this new VM is renamed with a 'rtvm-C4' prefix plus a unique ID, distinguishing it from the original source VM.

Resolution

This issue is resolved in VCDA 4.7.3. 
Manually delete all existing references to stale RT VMs from Cloud Director (VCD)

  1. SSH to the Cloud Availability manager appliance and open a session to VCD cell using VCD admin authentication:  vcd -k l <vcdcell IP> 'administrator@System' ‘password’
  2. Once the session is established, run the following command to fetch a list of RT-VMs (with only replication mode VMs):

    vcd -k g 'query?type=adminVApp&fields=name&filter=(hasOnlyReplicationModeVms==true)&pageSize=200'

  3. Execute the following command to retrieve the full list of active replications:  psql -U h4postgres -d h4cloud -c 'SELECT rtvapp_id, name FROM vappreplication;'
  4. Compare vApp UUIDs from step 2 with active replication rtvapp_id output captured from the database in step.3
  5. Remove identified stale RT VMs using:  vcd -k d vApp/vapp-<UUID> 

This process deletes entries from both VCD and vCenter, ensuring synchronization.

Additional Information

Error: "Could not compose a RT vApp for vApp replication..." when adding a VM replication to an existing vApp replication .

---

If an error similar to the following is seen prior to the http 200 response during the authentication call in step 1, it is likely that the JWT authentication token is not being parsed correctly and the subsequent calls using the vcd utility will fail:

vcd.sh: missing arg: SETTING_VALUE

This can occur when pointing to the virtual IP for the vCD environment, depending on the configuration of the load balancer, etc. To mitigate this issue, please try pointing directly to an individual vCD cell.