Invalid State of a Virtual Machine on VMWare ESXi (2023)

Invalid State of a Virtual Machine on VMWare ESXi generally triggers when we delete a virtual machine and the data remain in the VMWare vSphere/ESXi configuration for some reason.

As part of our Server Management Services we assist our clients with similar errors of the virtual machines.

Today, let’s find out the causes and effective solutions suggested by our Support Team.

Invalid State of a Virtual Machine on VMWare ESXi

As we mentioned earlier, this error might occur due to data that remain in the VMWare vSphere/ESXi configuration. In addition, this can happen after we manually remove VM files from the VMFS storage after running vMotion.

In these cases, we will not be able to delete a VM from vSphere Web Client using the built-in tools.

Invalid State of a Virtual Machine on VMWare ESXi (1)

Symptoms:

We may see one or more of these errors when trying to start a virtual machine:

Could not power VM, no swap file, failed to power on VM.
A general system error occurred. The system returned on error. Communication with the virtual machine may have been interrupted.

In this article, let us see what invalid virtual machines are, how they occur, and some effective solutions our Support Techs suggests.

(Video) Invalid Status of a Virtual Machine on VMWare How to remove it

Causes of ‘Invalid State of a Virtual Machine on VMWare ESXi’

In vCenter Server, an “orphaned” virtual machine is one that exists in the vCenter Server database but no longer present in ESX host inventory.

An “invalid” virtual machine is a VM that is inaccessible because the ESXi host is offline or inaccessible, the VM configuration file is locked or corrupt or contains a bad option, etc.

In the case of an orphaned virtual machine, we need to either re-register or remove the VM from inventory.

To re-register a virtual machine, we navigate to the VM’s location in the Datastore Browser and re-add the VM to inventory. To remove an orphaned VM from inventory, we right-click the VM and choose “Remove from inventory.”

In the case of invalid virtual machines there are many potential causes and it requires additional troubleshooting.

Let us now focus on the most common causes our Support Techs have come across.

  • ESXi host not responding or disconnected

We ensure that the ESXi host is accessible and available in the vCenter Server inventory. If the host is “Disconnected” or “Not responding,” all VMs on that host will be unavailable to vCenter.

  • VM configuration file is locked

To verify this, we navigate to the VM’s directory in the Datastore Browser for the appropriate datastore. We should see the VM configuration file (.vmx file) listed. If the icon for this file is a blank page instead of the VM icon, it can be a cause.

(Video) How to DELETE and REMOVE INVALID Unknown Virtual Machine (VM) from VMware ESXi 6.7 7.0

To verify that this is the case, we run the vmfsfilelockinfo command from the ESXi host to check the VM configuration file for a lock.

After the remedy, we need to remove the VM from inventory and r-register or reload it.

  • VM configuration file is missing

If the VM configuration file is missing, the VM will be “invalid” in the vCenter inventory.

To verify that this has occurred, we navigate to the VM’s directory in the Datastore Browser for the appropriate datastore.

If there is no VM configuration file with the “.vmx” extension and other files are available (logs, disks, etc.), then the file may need to be recreated.

After recreating the VM configuration file, the VM will need to be removed from inventory and reregistered or reloaded.

  • VM configuration file contains invalid options or text errors

If the VM configuration file is present, and the ESXi host is available in vCenter Server’s inventory, the VMX may have become corrupt or contain invalid options or text errors.

Most frequently, this will be missing quotation marks, invalid end-of-line, or an option that is not valid.

(Video) How to resolve failed to power on virtual machine in the current state powered off VM of Esxi

To determine the exact cause of the invalid option or text error we follow the below steps:

  1. Reload the VM configuration.
  2. Check the host management agent log file by viewing /var/log/hostd.log
    # tail -n50 /var/log/hostd.log
  3. We should see messages that indicate the reload failure.
    For example:
    info hostd[18267520] [Originator@6876 sub=vm opID=vim-cmd-61-609d user=root] File “/vmfs/volumes/5c182b95-ac4a587e-65f1-90b11c24698d/testVM/testVM.vmx” line 6: Syntax error.info hostd[18267520] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/5c182b95-ac4a587e-65f1-90b11c24698d/testVM/testVM.vmx opID=vim-cmd-61-609d user=root] Failed to load virtual machine
  4. If there is a “syntax error” listed, there is a fault in the VM configuration file.
    Examine the file and ensure that there are no issues with quotation marks, corrupt entries, invalid options, etc.
  5. After correcting the file, reload the VM again and determine if it returns to normal.

If it does not, we repeat this process to identify any additional faults.

  • VMware Tools Installation or Update

When we try to install or update VMware Tools, VM could also get into an invalid state.

The only way to remove such a VM is to use the SSH console of the ESXi host.

  1. Enable SSH on the ESXi host with the problem VM (Actions -> Settings -> Security Profile -> Services -> SSH -> Edit -> Start)
  2. Connect to the ESXi host using SSH client (Putty, mputty, etc.)
  3. To get the ID of the problem virtual machine, we run this command:
    vim-cmd vmsvc/getallvms | grep invalid
  4. A list of all VMs with the Invalid status registered on this host will be displayed. There should be a string like: Skipping invalid VM ’22’. In this case, 22 is the ID of the virtual machine
  5. To try and restore this VM in vSphere, we run the command:
    vim-cmd vmsvc/reload 22 (in a minute refresh the client interface and check the VM status)
  6. To unregister (delete) a problem virtual machine, we run the following command:
    vim-cmd /vmsvc/unregister 22
  7. 7. Refresh the vSphere client interface. The virtual machine with the Invalid status should disappear.

Also, to delete the problem VM manually from the host configuration file /etc/vmware/hostd/vmInventory.xml, delete the section containing the data of the problem VM from the vmInventory.xml file (backup the file before doing anything) in a text editor and restart the host services:

services.sh restart

[Need a helping hand with the process? We are available 24*7!]

Resolve running virtual machine with invalid status

If a running virtual machine gets the Invalid status, it is likely that the VM configuration file is corrupted.

To resolve the issue we follow the below steps:

(Video) Failed to reconfigure virtual machine. Invalid operation for device. ESXi

  • Remove the VM from the inventory and restart the ESXi host
  • Then, create a new VM and connect the virtual disks (vmdk) of the old VM to it (Use an existing disk)
  • Perform Storage vMotion to collect all files of the new VM in a single folder
  • Start new VM and make sure that it works
  • Finally, delete the files of the old VM

If the problem of the Invalid VM appear after losing access to VMFS storages, we will have to manually remove them from the inventory and manually register them.

To do that we have to find the VMX file of a virtual machine in the VMFS storage, right-clicking it and selecting Register VM. Then, start the VM and make sure that it is available.

[Still stuck with the error? Contact us now!]

Conclusion

In short, Invalid State of a Virtual Machine on VMWare ESXi, is an error VMWare administrators face. This article outlines the most common errors that relate to orphaned virtual machines and how our Support Engineers tackle it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

(Video) 5 Ways to Troubleshoot Unresponsive Virtual Machine | Troubleshoot VM Hung issues

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

FAQs

Why is VM status invalid on ESXi? ›

The Invalid Status issue is usually caused after attempting to delete a VM, manually removing VM files after a vMotion, a problem with the VMFS storage or even after physically removing the storage from the ESXi host e.g replacing a failed hdd.

What do you do if a virtual machine is in Hung State? ›

Virtual machines can become unresponsive/freeze/hang in the same way as a physical server for various reasons.
...
Action Plan
  1. Suspend the virtual machine and collect the . ...
  2. Collect logs from the host running the virtual machine. ...
  3. Power the virtual machine back on, then reset it.
Mar 25, 2021

How do I troubleshoot ESXi host issues? ›

When your VMware ESXi host is in a non-responding state
  1. Verify if the ESXi host is powered on by checking logs.
  2. Reconnect a disconnected host.
  3. Check connectivity via FQDN and IP address.
  4. Verify port 902.
  5. Try restarting ESXi management agents.
  6. Troubleshoot the VPXA agent.
  7. Check underlying storage issues.
  8. Final words.
Jul 8, 2019

How do I enable virtualization in ESXi virtual machine? ›

VMware VMs are enabled for ESXi.
...
To do this:
  1. Navigate to the VM Settings - Hardware page for the VM you would like to edit.
  2. Click Edit in the Guest OS settings section.
  3. Click the checkbox for Enable nested virtualization.

How do I fix invalid VM in ESXi? ›

If a running virtual machine gets the Invalid status, it is likely that the VM configuration file is corrupted. To resolve the issue we follow the below steps: Remove the VM from the inventory and restart the ESXi host. Then, create a new VM and connect the virtual disks (vmdk) of the old VM to it (Use an existing disk ...

How do I fix an invalid virtual machine? ›

If a running virtual machine gets the Invalid status, it is likely that the VM configuration file is corrupted. To resolve the issue: Remove the VM from the inventory and restart the ESXi host; Then create a new VM and connect the virtual disks (vmdk) of the old VM to it (Use an existing disk);

How do I reapply a virtual machine state? ›

Navigate to the VM that's stuck in the Failed state. Under Support + troubleshooting, select Redeploy + reapply. Select the Reapply option.

How do I reset a stuck virtual machine in vmware? ›

Procedure. Press the Option key and click Virtual Machine > Force Restart, the hard power option, to reset the operating system in your virtual machine.

How do I check if a disk is failing ESXi? ›

To identify the specific device that caused the failure:
  1. Log in to the applicable ESXi host via SSH or KVM/physical console.
  2. List vSAN disks using this command: # esxcli vsan storage list.
  3. Examine the output. ...
  4. The device in this state is the failed device, and should be replaced.
Feb 24, 2023

How do I check ESXi host status? ›

Note: hostd service and vpxa service are the two critical management agent services running on ESXi. You do have the option to see the status of other ESXi services by running the following command: # chkconfig -l.

How do I check ESXi network status? ›

Check the current status of the vmnic from either the VMware vSphere Client or the ESXi service console:
  1. To check the status from the vSphere Client: Select the ESX host and click the Configuration tab. Click Networking. ...
  2. To check the status from the ESXi service console, run this command: esxcli network nic list.
Mar 10, 2022

Why can I not enable virtualization? ›

In most cases where virtualization won't work, even if your CPU supports it, the cause is that you have the feature disabled in your computer's BIOS or UEFI. Though most modern computers support virtualization, it often comes disabled by default.

How do I connect to ESXi virtual machine? ›

Follow the steps to log in to the vSphere ESXi Host:
  1. Open the vSphere Client.
  2. Enter the IP address or name of the vSphere Hypervisor in the IP address / Name field.
  3. Enter the user name in the User name field.
  4. Enter the password in the Password field.
  5. Click Login.

How can you confirm if a virtual machine is not booting correctly? ›

Identify the reason why the boot disk isn't booting
  1. Verify that your boot disk is not full. ...
  2. Examine your virtual machine instance's serial port output. ...
  3. Enable interactive access to the serial console. ...
  4. Verify that your disk has a valid file system. ...
  5. Verify that the disk has a valid master boot record (MBR).

How do I restore a VM in ESXi? ›

Open the Home view. In the inventory pane, select the Backups > Disk node. Expand the backup job in the working area, right-click a VM in a backup job and select Restore entire VM to launch the Full VM Restore wizard.

How does a VM get corrupted? ›

Surveys by Ontrack reveal the leading reasons for VM data loss to be user error, ransomware, hardware failures, formatting, metadata corruption, and RAID storage corruption.

How do I force delete a VM in ESXi? ›

Go to Protect > VMware. List of all the registered VMware vCenter Servers and ESXi Hypervisors is displayed. Select the desired vCenter Server or ESXi Hypervisor that you want to delete. Click Delete.

What is a virtual invalid? ›

An "invalid" virtual machine is a VM that is inaccessible because the ESXi host is offline or inaccessible, the VM configuration file is locked or corrupt or contains a bad option, or other possible causes.

How do I delete an unregistered virtual machine? ›

Remove VMs or virtual services from inventory
  1. For a VM, select the VM, then select Actions > Configuration Management > Remove from Inventory.
  2. For a virtual service, select the virtual service, then select Actions > Remove from Inventory and confirm the removal.
Jan 10, 2023

What are three reasons why a virtual machine might fail to power on? ›

The failure of a VM to power on may be caused by any of the following reasons:
  • ESXi OS problems.
  • File corruption.
  • File locks.
  • Guest OS problems.
  • License problems.
  • Network problems.
  • Storage Array/Datastore problems.
  • User permissions.
Jan 11, 2022

How do I fix the virtual machine agent status is not ready? ›

Troubleshooting VM agent that is in Not Ready status
  1. Step 1 Check whether the Azure VM Agent service is installed. Check for the Package. ...
  2. Step 2 Check whether auto-update is working. The Azure VM Agent has an auto-update feature. ...
  3. Step 3 Check whether the VM can connect to the Fabric Controller.
Oct 7, 2022

What happens to virtual machines when server fails in a? ›

Failover clusters are used to recover VMs from server failure, providing high availability for critical VMs. If one of the hosts (which are called nodes) within a cluster fails, then the VMs that were running on the failed host migrate (failover) to other healthy hosts.

Why would you need to preserve the state of a virtual machine? ›

The advantages to saving a file to disk and closing the program or saving the state of a VM is that both allow data to survive system or host crashes, but the disadvantages to both these scenarios is that reopening a program is slower than restoring a running program's minimized window, as is reloading a VM's state ...

How do I get VM status? ›

Check the Status of an Individual Virtual Machine
  1. In the vSphere Client, navigate to a virtual machine.
  2. On the Updates tab, click Check Status. The Scan entity task appears in the Recent Tasks pane. After the task finishes, status information appears in the VMware Tools and VM Hardware Compatibility panels.
Mar 17, 2020

How do I force a VM to forcefully restart? ›

If the VMware Workstation user interface is not responding due to the frozen virtual machine, you may have to force the virtual machine to shut down from Windows Task Manager. Click Start > Run, type taskmgr, and click OK.

How do I restart a hanged virtual machine? ›

Open the Server Automation domain. From the navigation tree in the Server Automation domain, click Virtualization > Virtual Machine Management > Power Configuration to open the list of Power Configuration Tasks. From the Power Configuration list, select Restart VM (soft).

What is the command to reboot the VM virtual machine? ›

sudo shutdown -r now This will perform a system shutdown in a proper way and then reboot the computer. sudo shutdown -h now This will perform a system shutdown in a proper way.

How do I know if my disk is corrupted? ›

Right-click on the drive that you wish to scan - most commonly this will be your C: Drive or D: Drive - then click Properties. The Properties window for the selected drive will now open. Here, click the Tools tab and then click Check under the Error checking section.

How do you check if your disk is damaged? ›

test: Type cmd or command into the taskbar search field and click Command Prompt to open the Command Prompt. In the Command Prompt, type in wmic diskdrive get status and press Enter. If the status reads OK, that means you've passed the Windows 10 hard drive test and your hard drive is healthy.

How do I know if my disk is failing? ›

Common signs for a failing hard drive include sluggish performance, unusual noises (clicking or loud component sounds), and an increase number of corrupted files. These are textbook symptoms for the inevitably of a failing hard drive and action should be taken quickly to save your files from being lost.

How do I check my ESXi boot disk? ›

To verify which physical device is the boot device on ESXi:
  1. Run this command for a vm-support-based investigation: cat vm-support*/tmp/esxcfg-info.*.txt | grep -A10 "Diagnostic Partition" ...
  2. Run this command on a live support-mode session: esxcfg-info -s | grep -A10 "Diagnostic Partition"
Jul 19, 2016

How do I know if a port is open on ESXi host? ›

After connecting to your ESXi host, go to Networking > Firewall Rules. You'll see that the VMware Host Client displays a list of active incoming and outgoing connections with the corresponding firewall ports.

What are the VMware troubleshooting commands? ›

Some of the commands that can be used for networking troubleshooting include net-dvs , Esxcli network , vicfg-route , vicfg-vmknic , vicfg-dns , vicfg-nics , and vicfg-vswitch . You can use the net-dvs command to troubleshoot VMware distributed dvSwitches.

How to check port connectivity in ESXi? ›

On the ESXi host:
  1. Use the telnet command to check if the IP address of the subsystem and port are not blocked. If the telnet command is not available, use the netcat ( nc ) command: [root@esxi05:~] nc -z 172.18.21.191 8009. ...
  2. Use the vmkping command to check if the subsystem is reachable from the ESXi host.

What is the difference between admin status and link status in ESXi? ›

To check NIC link status from the ESXi service console

Note: The Admin Status is the only portion of the output that ESXi controls. The link status column specifies the status of the link between the physical network adapter and the physical switch. The link status can be either Up or Down.

How do I know if my ESXi is booting from SAN? ›

Obtain the bootbank and altbootbank UUIDs by running this command:
  1. ls -l /
  2. lrwxrwxrwx 1 root root 49 Oct 27 17:55 altbootbank -> /vmfs/volumes/bebbef72-6cbc41fa-b169-68d3824c6d51. ...
  3. vmkfstools -P path.
  4. vmkfstools -P /vmfs/volumes/bebbef72-6cbc41fa-b169-68d3824c6d51.
  5. vfat-0.04 file system spanning 1 partitions.
Mar 31, 2021

How do I stop disabling virtualization? ›

From the System Utilities screen, select System Configuration > BIOS/Platform Configuration (RBSU) > System Options > Virtualization Options > Virtualization Technology and press Enter. Select a setting and press Enter.

Why is virtualization disabled by default? ›

CPU virtualization is usually disabled by default because it protects computers from security risks and improves the overall performance of the PC. You can quickly turn on your computer's hardware virtualization by entering your BIOS and turning on the right settings.

Do I have to enable virtualization? ›

If you are planning to install any virtualization application, you have to. Otherwise, it is better to disable it, because it has a small penalty, and your computer gets slower. You should activate hardware virtualization if you wish to use a virtual machine application like VirtualBox and have 64-bit virtual machines.

What if virtualization is disabled? ›

If virtualization is turned off, you will see “No” in front of the option “Virtualization Enabled in Firmware”. This means that your system does not support hardware virtualization.

How do I enable virtualization in vmware virtual machine? ›

To do this:
  1. Navigate to the VM Settings - Hardware page for the VM you would like to edit.
  2. Click Edit in the Guest OS settings section.
  3. Click the checkbox for Enable nested virtualization.

How to set BIOS for virtualization? ›

Turn on the computer, and then immediately press f10 to open BIOS Setup. Use the arrow keys to select the Configuration tab, and then select Virtualization Technology. Select Enable. Press f10 to save the settings and exit BIOS Setup.

Where are VMS on ESXi host? ›

Log in as root with SSH to both affected ESXi hosts. Run the vim-cmd vmsvc/getallvms command to display the names of the virtual machines registered on this host. Run the esxtop and then press shift + V keys to show which virtual machines are currently running on the ESXi host.

How do I connect my VM to my hosting machine? ›

Configuration
  1. Configure a static IP address.
  2. Modify the default login password for the virtual machine.
  3. Modify the keyboard layout.
  4. Learn about the Bitnami Configuration Tool.
  5. Enable desktop access.
  6. Install VirtualBox Guest Additions.
  7. Configure the application's IP address or hostname.
  8. Install Webmin.
Oct 10, 2022

Which tool is used to directly connect to an ESXi Server? ›

You can use the vSphere Client to connect directly to the ESXi host. If you use vCenter Server, you can use the vSphere Client to connect to and control the vCenter Server. Administrators can also use the vSphere Web Client to connect to and operate vCenter Server via a web browser.

How do I fix an invalid VM? ›

If a running virtual machine gets the Invalid status, it is likely that the VM configuration file is corrupted. To resolve the issue: Remove the VM from the inventory and restart the ESXi host; Then create a new VM and connect the virtual disks (vmdk) of the old VM to it (Use an existing disk);

How do I know if VMS is running on ESXi? ›

To confirm that your virtual machine is powered on:
  1. Check the state of the virtual machine according to the vCenter Server by pointing the vSphere Client at your vCenter Server host. ...
  2. Check the state of the virtual machine according to the ESX/ESXi host by directly pointing the vSphere Client at the ESX/ESXi Server host.
Sep 24, 2020

How do I reset a VMware virtual machine? ›

Procedure. Press the Option key and click Virtual Machine > Force Restart, the hard power option, to reset the operating system in your virtual machine.

Why is VMware showing an error? ›

The error “VMware Workstation Unrecoverable Error: (vcpu-0)” could be caused by a range of different issues, like: Another virtualization software is running at the same time. Secure Virtual Machine (SVM) is disabled from BIOS. Simultaneous Multithreading (SMT) is enabled.

How would you troubleshoot a VM that isn't booting? ›

Identify the reason why the boot disk isn't booting
  1. Verify that your boot disk is not full. ...
  2. Examine your virtual machine instance's serial port output. ...
  3. Enable interactive access to the serial console. ...
  4. Verify that your disk has a valid file system. ...
  5. Verify that the disk has a valid master boot record (MBR).

How do I restart the VM agent service? ›

Solution
  1. Follow the instructions for updating the Linux VM agent. Note. ...
  2. Ensure that the Azure agent is running on the VM by running the following command: ps -e. If the process isn't running, restart it by using the following commands: ...
  3. Configure the auto restart agent.
  4. Run a new test backup.
Feb 2, 2023

How do you reset a virtual machine? ›

To reset a virtual machine:
  1. Click Compute → Virtual Machines and select a running virtual machine.
  2. Click the down arrow next to Reboot, then click Reset, or right-click the virtual machine and select Reset from the pop-up menu.
  3. Click OK in the Reset Virtual Machine(s) confirmation window.

How do I know if my VM is working? ›

For Windows:
  1. Click Start > Run.
  2. Type msinfo32 and press Enter.
  3. In the right pane, look for System Manufacturer for 'VMware, Inc. ' If this is present, you are running within a virtualized platform, and cannot install another virtualization product on top of it.
Sep 8, 2017

How do I enable a virtual machine? ›

Here's how to turn it on:
  1. Select Start, enter Windows features, and select Turn Windows features on or off from the list of results.
  2. In the Windows Features window that just opened, find Virtual Machine Platform and select it.
  3. Select OK. You might need to restart your PC.

How to get status of VM using PowerShell? ›

To see all VMs on the local Hyper-V host, you should run the Get-VM cmdlet. On the PowerShell screen, you can see the list of available VMs, including their name, state, CPU usage, memory assigned, uptime, status, and version.

How to check VM power status in ESXi command? ›

ESXi 4. x, 5. x and 6. x
  1. List the inventory ID of the virtual machine with the command: vim-cmd vmsvc/getallvms |grep <vm name> ...
  2. Check the power state of the virtual machine with the command: vim-cmd vmsvc/power.getstate <vmid>
  3. Power-on the virtual machine with the command: vim-cmd vmsvc/power.on <vmid>
Feb 12, 2020

How do I check my ESXi status? ›

You do have the option to see the status of other ESXi services by running the following command: # chkconfig -l.

How to check disk status in ESXi command? ›

To read the current data from a disk:
  1. Open a console or SSH session to the ESXi host. ...
  2. Determine the device parameter to use by running the command: ...
  3. The expected output is a list with all SCSI devices seen by the ESXi host. ...
  4. Read the data from the device where device is a value found in step 3:
Feb 11, 2020

Videos

1. restore Orphaned VMs from, ESXI
(QQFix)
2. How to Power on / Recovering inaccessible VMs on datastore
(Computer Basic Knowledge)
3. Registering and Unregistering Virtual Machines in vCenter Server Inventory
(NT-Virtual Lab)
4. Steps to power On or Off Virtual Machine when ESXi is not responding
(vStudentblog)
5. How to delete/unregister invalid virtual machine from ESXi hypervisor 6.5 using WebUI.
(Syneto)
6. How to Recover Virtual Machine Data from VMWare vSphere ESXi Hypervisor with VMFS File System
(Hetman Software: Data Recovery for Windows)

References

Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated: 27/08/2023

Views: 6152

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.