Hello,
in a standalone esxi 6.5, during the import of a vm via web client I stopped it, so now I have an entry in the web client that point to a vmx file that doesn't exists: in the list of virtual machines in the web client I have, as virtual machine name, the path of the vm that doen't exists and in Status field the "invalid" value.
How I can delete the entry? Is it possible?
I attach an image with 2 vm, the one invalid and one valid:
--
Regards
This worked for me
vim-cmd /vmsvc/getallvms
to list all registered VMs
get the ID of the VM you removed the files for (the first column of output). Mine said invalid vm skipped but showed the ID
vim-cmd /vmsvc/unregister <id>
to unregister that VM.
This solution was from the following
https://www.reddit.com/r/homelab/comments/708u3o/deleted_vmx_file_cannot_remove_vm_esxi/
In the inventory, find the invalid VM -> right click -> remove from inventory or sometimes you find it under more options
On the ESXi host -> select the VM -> Actions (on the top) -> remove from inventory
Once removed from ESXi host - > the VM shows as orphaned
Thanks,
MS
Hello,
thanks for you reply. If I right click on the entry the only options that I have and that are not grey are "Power", "Autostart" and "Help" but they are unusable; if you see in the image that I have attached in the previous post I haven't a name of a virtual machine but the path of the datastore where there were the vmx file (that isn't exists anymore).
--
Regards
Click on Actions -> Unregister
If only... I have the same problem, and those options are not available:
I've been at this for quite a while. Most of the solutions assume access to vSphere vCenter, but I am only running ESXI and the web client. Can't unregister or destroy this machine from CLI using vim-cmd options, so I'm at a loss. Other ideas?
This looks like an issue which definitely needs to be resolved.
As a workaround, you may:
After a "Refresh" in in the VM view in the Web GUI, you should see a "dummy" VM which you can now delete.
André
Discussion moved from ESXi to vSphere Host Client
Hello skippermdj & marcomangiante,
You should be able to permanently remove any inventory reference to this VM by removing the five lines that refer to this entry in /etc/inventory/hostd/vmInventory.xml e.g.:
<ConfigEntry id="0002">
<objID>3</objID>
<secDomain/>
<vmxCfgPath>/vmfs/volumes/590cca43-c78bd3ac-1234-000c2908a466/VMware vCenter Server Appliance/VMware vCenter Server Appliance.vmx</vmxCfgPath>
</ConfigEntry>
Copy a back-up before doing this and use vi to edit the file.
Stop vpxa and hostd before edit:
#/etc/init.d/vpxa stop
#/etc/init.d/hostd stop
restart these after edit:
#/etc/init.d/vpxa start
#/etc/init.d/hostd start
Bob
This worked for me
vim-cmd /vmsvc/getallvms
to list all registered VMs
get the ID of the VM you removed the files for (the first column of output). Mine said invalid vm skipped but showed the ID
vim-cmd /vmsvc/unregister <id>
to unregister that VM.
This solution was from the following
https://www.reddit.com/r/homelab/comments/708u3o/deleted_vmx_file_cannot_remove_vm_esxi/
I just had this issue as well. After an hour or 2 I found the solution!
'
Select the check box of the one "you want to delete" and a "powered on VM" select Actions on top, it should be something you can finally select now. Now select unregister it will notify you that both vms will be removed. But actually only the one vm (or path of that vm\.vmx at the end of the naming convention) you want will be removed because it is powered off. Let me know if this works for you. Or to be safe stand up a test VM and leave it powered on as your second VM. Good luck, let me know if this works for you.
This worked for me! Simple and fast.
Thank you!
Thanks! These instructions worked exactly as detailed. I only have an ESXi 6.5 that had this problem from before I've looked at it.
Awesome!
This is the right answer
Very well done. Looking for a solution since months ('cause I had no time to work on it), and it was a 10 secs fix thanks to you. Thanks dude !
Thank you, it works like a charm: awesome solution.
This was super useful. Thank you to everyone involved for creating this topic and posting a simple resolution.
thanks the solution worked great !!!
Fast and easy. Worked fine for me. Thank you!
Thanks
Thanks mate. I figured that a could substitute a 'clean' vmx file. I just hadn't spotted the "Skipping invalid VM###" or realised that I could force reload with vim-cmd vmsvc/reload 👍