VMware Cloud Community
eccl1213
Enthusiast
Enthusiast

Unable to delete VM from vCenter (Force Deleted from vCloud)

Working with a customer that deleted a VM from vCloud.

The VM went into the stranded folder so the customer preformed a "force delete" which did clean it up from vCloud.

The VM is no longer visable vCloud, but the VM is still registered in vCenter and exist on the datastore.

When we right click the vm in vCenter, the "delete from disk" is greyed out.  How do we unprotect the VM so we can delete the physical VM?

4 Replies
msk05
Hot Shot
Hot Shot

Power off the VM and then try to delete it.

0 Kudos
eccl1213
Enthusiast
Enthusiast

Yes, the VM is certainly off.

Tech support was able to fix it.  The vCenter DB had to be modified.  It was a similar scenario to View Replicas that get "delete inhibited" in the vcenter db.

0 Kudos
AdamRushUK
Enthusiast
Enthusiast

That function might have been disabled, which you can check using PowerCLI:

$vm = Get-Vm -Name TestVM-1

$vm.ExtensionData.DisabledMethod

To avoid modifying the DB directly, there is a script you can use to enable/disable these methods: http://www.virtuallyghetto.com/2016/07/how-to-easily-disable-vmotion-cross-vcenter-vmotion-for-a-par...

I used it only this week to re-enable the ability to migrate a VM, as "Migrate" was greyed out in vCenter.

Worked a treat!

VCP-Cloud | VCP5-DCV | MCITP:EA | MCSE | CCNA | CCAA LinkedIn: https://www.linkedin.com/in/adamrushuk | Twitter : @adamrushuk
BAllen22
Contributor
Contributor

This method absolutely helped me fix my issue.  I had a replica from a previous Horizon View instance that was orphaned following removal of the datastores and this worked perfect.  Once I was able to enable the "Destroy_Task" method, I could successfully delete the replica VMs via PowerCLI.

0 Kudos