Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to remove orphaned VM from vCenter the easy way

I have lately had few orphaned VMs in my Home Lab Vcenter, as I was recreating my setup. Some of the Virtual machines were deleted directly from ESXi host, but still had records in the vCenter inventory. Below how orphaned VMs looked in my vCenter.

I have looked online for a way to Remove these orphaned VMs, and while one of the KB article suggested to add it to a folder then remove the folder, that did not work as that KB was only for older versions of vSphere.

One method to do this, is to use one of the below command lines methods where any of them will do the trick:

PowerCLI
Remove-VM vm_name -deletepermanently

vMA
vmware-cmd --server esxhost –s unregister path_to_vmx_file
vmware-cmd --server vcenter --vihost esxhost –s unregister path_to_vmx_file vifs --server esxhost --rm “[datastore] path_to_vmx_on_datastore

CLI
vim-cmd vmsvc/destroy vmid

For those lazy ones, that don’t want to fire up a command line utility and then construct a command line to do the trick, I have a good news for you. You can delete that orphan VM in the GUI by right clicking the VM, then choosing All Virtual Infrastructure Actions ==> More UnCategorized Actions ==> Remove from Inventory. … Read More



This post first appeared on Virtualization Team, please read the originial post: here

Share the post

How to remove orphaned VM from vCenter the easy way

×

Subscribe to Virtualization Team

Get updates delivered right to your inbox!

Thank you for your subscription

×