I have problems with couple VM. They were linked clone desktops. I could not delete them from Horizon View Administrator. All VM was stuck. Pool could not be deleted too. So i used KB1008658 http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100865... I have deleted VM's from database. Everything was fine. I am stuck in this KB's last article (Deleting the virtual machine from vCenter Server). VM's are powered off. In vSphere client i try to use function "delete from disk". I get message: the operation is not allowed in the current state. I can not delete machine. If i try to power it on i get message: no host is compatible with the virtual machine. How can i correctly revome those machines from vsphere client?
|Right-click the virtual machine in VC and select Remove from Inventory.|
Right-click the virtual machine and select Delete from Disk.
For both these you need to power off the VM first.
You could probably go to below location of that particular host were the VM resides and remove the complete VM entry.
Hope this helps.
To delete an orphaned virtual machine:
If a host is maintaining a lock on the virtual machine files, connect directly to the host with the vSphere Client as root to determine the virtual machine status and try to power off and remove the virtual machine from inventory.
I have the same problem, but I want to remove the orphaned VM via some CLI for automation purpose.
I used “vim-cmd vmsvc/destroy <VM ID>” in ESX server, but it’s marked as “orphaned” in vCenter
Is there a way to complete remove VM via some CLI?
I've been battling this for a while, and the folder approach didn't work for me because I couldn't move the orphaned VMs to new folders (I am using vSphere 6.5). For some, I just moved the other virtual machines that I didn't want to delete out of the folder and then removed it. This was a crappy solution for me because some folders had large amounts of VMs.
I ended up connecting to the vSphere server using VMware Fusion and deleting the remaining ones from there, and it worked like a charm - although a very questionable enterprise solution. I expect this might work with VMware Workstation, as well.
I just had to use PowerCLI, worked like a charm I might add.
You can leave off the Confirm:0 part
I deleted a VM directly from the ESXi host and it left it orphaned in vSphere. I followed the article as described here - Deleting an orphaned virtual machine when the Remove option is not available (1011468) | VMware KB
No dice. The solution was to use PowerCLI to permanently delete the VM from the vSphere environment.
Yep, this worked for me --
I used vim-cmd to get all vms and identified the two I needed to get rid of
$ vim-cmd vmsvc/getallvms
the two that I had that were orphaned were at the very top
I edited the vmInventory.xml file
$ vi /etc/vmware/hostd/vmInventory.xml
(use dd to delete a line at a time, :wq to exit and save, :!q to exit without saving)
I then reset these two services:
$ /etc/init.d/hostd restart
then reloaded the web UI and they were gone. Hope this helps someone else.
I had the same issue. I could not remove from inventory via the flash vSphere Web Client. I could, however, log into the HTML5 version of the Web Client and had the ability. Another nail in the flash coffin.