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?
VM must be registered to ESX host. can you check using command line in esx host?
A
so you want to remove VM from Vcenter inventory or want to remove with data store ?
Your Oscar
Please go through this
Hope this helps
-SatyS
I want to remove from inventory (and datastore).
All my hosts are ok. And "resources" are good and alive.
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.
-SatyS
VM's are powered off. In summary tab you can see machines state: powered off.
Hi,
You could probably go to below location of that particular host were the VM resides and remove the complete VM entry.
/etc/vmware/hostd/vmInventory.xml
Hope this helps.
Regards
Jidhin
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.
Hi
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?
Thx
Do this from PowerCLI
path to powercli\Initialize-PowerCLIEnvironment.ps1
out_remove= Remove-VM VM-name -DeletePermanently -Confirm:$false
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
$/etc/init.d/vpxa restart
then reloaded the web UI and they were gone. Hope this helps someone else.
I can confirm this trick also works with workstation and vSphere 6.5. Nice tip
For me worked connect to vsphere by VMware Workstation and there option to remove was active.
This is the way@
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.