[Guide] Managing corrupted / unaccessible / unknown / invalid VMs from the ESXi host

If the ESXi host gets powered off unexpectedly (due to power failure), some virtual machines can become corrupted or inaccessible.
A virtual machine can become corrupt if:
  • Too many snapshots (32 or more) are created
  • The virtual machine configuration file is corrupt
  • The virtual machine guest operating system is not supported
To determine which virtual machine is corrupted:
  1. In a SSH/Putty connection, connect to the ESX host.
  2. Backup the /etc/vmware/hostd/vmInventory.xml file.
  3. Run the command:

    mv /etc/vmware/hostd/vmInventory.xml /etc/vmware/hostd/vmInventory.xml.bak

  4. Restart the hostd process. For more information, see Restarting the Management agents on an ESX or ESXi Server (1003490).
  5. Right-click the ESX host and choose Connect.

    If the ESX host connects successfully, then a corrupt virtual machine is preventing your ESX host from connecting to the vCenter Server inventory.

    Note: After performing these steps, all of the virtual machines appear orphaned in vCenter Server. If you connect directly to the ESX host, you do not see any virtual machines.

To resolve this issue, open the vmInventory.xml file, and add one virtual machine entry from the vmInventory.xml.bak file at a time, then add the ESX host into inventory until you have determined the problematic virtual machine. 

vmInventory entries look like:
 <ConfigEntry id="0002">
    <vmxCfgPath>/vmfs/volumes/4cb73eef-89346b13-8872-002219d2a8b2/Win 2003 Test/Win 2003 Test.vmx</vmxCfgPath>
When you have determined the problematic virtual machine, you remove the entry in the vmInventory.xml file, then add the ESX host into inventory. Power off the virtual machine, unregister, and add the virtual machine to the inventory.
In some rare cases, the datastore ID may change after a power failure. In this case you can just replace the datastore ID directly in the vmInventory.xml file, then restart the services:  services.sh restart
The datastore ID is basically the path from /vmfs/volumes, for example: /vmfs/volumes/4cb73eef-89346b13-8872-002219d2a8b2
Attached Files
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Security Code Security Code
Related Articles RSS Feed