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.
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.
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.
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.
To determine the exact cause of the invalid option or text error we follow the below steps:
- Reload the VM configuration.
- Check the host management agent log file by viewing /var/log/hostd.log
# tail -n50 /var/log/hostd.log
- 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
- 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. - 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.
- Enable SSH on the ESXi host with the problem VM (Actions -> Settings -> Security Profile -> Services -> SSH -> Edit -> Start)
- Connect to the ESXi host using SSH client (Putty, mputty, etc.)
- To get the ID of the problem virtual machine, we run this command:
vim-cmd vmsvc/getallvms | grep invalid
- 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
- 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)
- To unregister (delete) a problem virtual machine, we run the following command:
vim-cmd /vmsvc/unregister 22
- 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:
- 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.
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? ›...
Action Plan
- Suspend the virtual machine and collect the . ...
- Collect logs from the host running the virtual machine. ...
- Power the virtual machine back on, then reset it.
- Verify if the ESXi host is powered on by checking logs.
- Reconnect a disconnected host.
- Check connectivity via FQDN and IP address.
- Verify port 902.
- Try restarting ESXi management agents.
- Troubleshoot the VPXA agent.
- Check underlying storage issues.
- Final words.
...
To do this:
- Navigate to the VM Settings - Hardware page for the VM you would like to edit.
- Click Edit in the Guest OS settings section.
- Click the checkbox for Enable nested virtualization.
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? ›- Log in to the applicable ESXi host via SSH or KVM/physical console.
- List vSAN disks using this command: # esxcli vsan storage list.
- Examine the output. ...
- The device in this state is the failed device, and should be replaced.
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? ›
- To check the status from the vSphere Client: Select the ESX host and click the Configuration tab. Click Networking. ...
- To check the status from the ESXi service console, run this command: esxcli network nic list.
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? ›- Open the vSphere Client.
- Enter the IP address or name of the vSphere Hypervisor in the IP address / Name field.
- Enter the user name in the User name field.
- Enter the password in the Password field.
- Click Login.
- Verify that your boot disk is not full. ...
- Examine your virtual machine instance's serial port output. ...
- Enable interactive access to the serial console. ...
- Verify that your disk has a valid file system. ...
- Verify that the disk has a valid master boot record (MBR).
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? ›- For a VM, select the VM, then select Actions > Configuration Management > Remove from Inventory.
- For a virtual service, select the virtual service, then select Actions > Remove from Inventory and confirm the removal.
- ESXi OS problems.
- File corruption.
- File locks.
- Guest OS problems.
- License problems.
- Network problems.
- Storage Array/Datastore problems.
- User permissions.
How do I fix the virtual machine agent status is not ready? ›
- Step 1 Check whether the Azure VM Agent service is installed. Check for the Package. ...
- Step 2 Check whether auto-update is working. The Azure VM Agent has an auto-update feature. ...
- Step 3 Check whether the VM can connect to the Fabric Controller.
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? ›- In the vSphere Client, navigate to a virtual machine.
- 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.
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? ›
- Run this command for a vm-support-based investigation: cat vm-support*/tmp/esxcfg-info.*.txt | grep -A10 "Diagnostic Partition" ...
- Run this command on a live support-mode session: esxcfg-info -s | grep -A10 "Diagnostic Partition"
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? ›- 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. ...
- Use the vmkping command to check if the subsystem is reachable from the ESXi host.
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.
- ls -l /
- lrwxrwxrwx 1 root root 49 Oct 27 17:55 altbootbank -> /vmfs/volumes/bebbef72-6cbc41fa-b169-68d3824c6d51. ...
- vmkfstools -P path.
- vmkfstools -P /vmfs/volumes/bebbef72-6cbc41fa-b169-68d3824c6d51.
- vfat-0.04 file system spanning 1 partitions.
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? ›
- Navigate to the VM Settings - Hardware page for the VM you would like to edit.
- Click Edit in the Guest OS settings section.
- Click the checkbox for Enable nested 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? ›- Configure a static IP address.
- Modify the default login password for the virtual machine.
- Modify the keyboard layout.
- Learn about the Bitnami Configuration Tool.
- Enable desktop access.
- Install VirtualBox Guest Additions.
- Configure the application's IP address or hostname.
- Install Webmin.
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? ›- Check the state of the virtual machine according to the vCenter Server by pointing the vSphere Client at your vCenter Server host. ...
- 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.
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? ›- Verify that your boot disk is not full. ...
- Examine your virtual machine instance's serial port output. ...
- Enable interactive access to the serial console. ...
- Verify that your disk has a valid file system. ...
- Verify that the disk has a valid master boot record (MBR).
How do I restart the VM agent service? ›
- Follow the instructions for updating the Linux VM agent. Note. ...
- 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: ...
- Configure the auto restart agent.
- Run a new test backup.
- Click Compute → Virtual Machines and select a running virtual machine.
- Click the down arrow next to Reboot, then click Reset, or right-click the virtual machine and select Reset from the pop-up menu.
- Click OK in the Reset Virtual Machine(s) confirmation window.
- Click Start > Run.
- Type msinfo32 and press Enter.
- 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.
- Select Start, enter Windows features, and select Turn Windows features on or off from the list of results.
- In the Windows Features window that just opened, find Virtual Machine Platform and select it.
- Select OK. You might need to restart your PC.
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? ›- List the inventory ID of the virtual machine with the command: vim-cmd vmsvc/getallvms |grep <vm name> ...
- Check the power state of the virtual machine with the command: vim-cmd vmsvc/power.getstate <vmid>
- Power-on the virtual machine with the command: vim-cmd vmsvc/power.on <vmid>
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? ›- Open a console or SSH session to the ESXi host. ...
- Determine the device parameter to use by running the command: ...
- The expected output is a list with all SCSI devices seen by the ESXi host. ...
- Read the data from the device where device is a value found in step 3: