Quite typically, VMWare directors are confronted with the truth that the listing of digital machines incorporates VMs with the Invalid (Unknown) standing. As a rule, the problem happens after deleting a digital machine, which knowledge remained within the VMWare vSphere/ESXi configuration on some purpose. This may also occur after you manually take away VM information from the VMFS storage after operating vMotion and in another instances. You received’t be capable to delete such a VM from vSphere Web Client utilizing the built-in instruments (the Unregister choice within the Actions menu is inactive).
The solely method to take away such a VM is to make use of the SSH console of the ESXi host.
- Enable SSH on the ESXi host with the issue VM (Actions -> Settings -> Security Profile -> Services -> SSH -> Edit -> Start);
- Connect to the ESXi host utilizing SSH shopper (Putty, mputty, and so on.);
- To get the ID of the issue digital machine, run this command:
vim-cmd vmsvc/getallvms | grep invalid
- A listing of all VMs with the Invalid standing registered on this host can be displayed. There ought to be a string like:
Skipping invalid VM '22'. In this case, 22 is the ID of the digital machine;
- If you wish to try to restore this VM in vSphere, run the command:
vim-cmd vmsvc/reload 22(in a minute refresh the shopper interface and test the VM standing);
- If you wish to unregister (delete) a downside digital machine, run the next command:
vim-cmd /vmsvc/unregister 22
- Refresh the vSphere shopper interface. The digital machine with the Invalid standing ought to disappear.
Also you possibly can manually delete the issue VM from the host configuration file /and so on/vmware/hostd/vmInventory.xml. To do it, delete the part containing the info of the issue VM from the vmInventory.xml file (backup the file earlier than doing something) in a textual content editor (vi, nano) and restart the host providers:
If a operating digital machine will get the Invalid standing, it’s doubtless that the VM configuration file is corrupted. To resolve the problem:
- Remove the VM from the stock and restart the ESXi host;
- Then create a new VM and join the digital disks (vmdk) of the outdated VM to it (Use an present disk);
- Perform Storage vMotion to gather all information of the brand new VM in a single folder;
- Start your new VM and ensure that it really works;
- Delete the information of the outdated VM.
If the issue of the Invalid VM appeared after shedding entry to VMFS storages, when the entry is restored the began VMs will run and the stopped ones will change into remoted. You should manually take away them from the stock and manually register them by discovering the VMX file of a digital machine within the VMFS storage, right-clicking it and choosing Register VM. Then begin the VM and ensure that it’s obtainable.