Remove Invalid VM

First get a list of all VMs:

vim-cmd vmsvc/getallvms

Identify the invalid vms:

[root@esxi1:~] vim-cmd vmsvc/getallvms
Skipping invalid VM '1605'
Skipping invalid VM '1606'
Skipping invalid VM '1607'
Vmid             Name                                                 File                                             Guest OS          Version                            Annotation
1097   srv1                       [nfs_q4_vmbak] srv1_q4-201704210958/srv1_q4-201704210958.vmx                   centos64Guest           vmx-13    srv1 = Firewall / Router zum Internet
1098   srv3_q4-201704211532       [nfs_q4_vmbak] srv3_q4-201704211532/srv3_q4-201704211532.vmx                   centos64Guest           vmx-13    srv3 = DNS

Then remove the VMs with the invalid id:

vim-cmd vmsvc/unregister 1605


Authors:
  • Jochen Schnuerle