Before VMware vCenter 6.5, deleting orphaned VMs was really easy. You just needed to connect with the VMware vSphere Client (the fat client) to the vCenter server, create a new folder, move the broken stuff in it, and delete the folder.
Well… on vCenter 6.5, that’s not possible anymore as you can’t connect with the vSphere Client on the vCenter server, just to the ESXi.
The only workaround for this was to use PowerCLI (version 6.5 can be downloaded from here)
After installing PowerCLI, start it from your Desktop or from the Start Menu and type:
Connect-VIServer -Server YourvCenterServer
You’ll now be prompted for credentials needed to login in vCenter.
The following command will show you all VMs registered in vCenter
Get-VM -Name *
And to delete the orphaned one(s)
Get-VM -Name YourOrphanedVMName | Remove-VM
To see all running VMs and a bunch of other info type:
Get-VM | select * | Out-GridView
When you deleted all your VMs, you should also check to see if the process left behind some crap like unused VMDKs.