Knowledge Base

|
Virtual machines appear as invalid or orphaned in vCenter Server
Symptoms
- Virtual machines show as invalid or orphaned in vCenter Server.
- Virtual machines show as invalid or orphaned after a VMware High Availability (VMware HA) host failure occurs
- Virtual machines show as invalid or orphaned after an ESX host comes out of maintenance mode
- Virtual Machines show as invalid or orphaned after a failed DRS migration.
- You 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.VMControl error -11: No such virtual machine.A general system error occurred. The system returned on error. Communication with the virtual machine may have been interrupted .
Purpose
This article explains what orphaned virtual machines are, how they occur, and how you can fix them. The article outlines the most common errors that relate to orphaned virtual machines and how these issues can be resolved.
Resolution
Notes:
- Before you begin, refer to Restarting the Management agents on an ESX or ESXi Server (1003490) for important information on restarting the
mgmt-vmwareservice. - These solutions may require the use of the
vmware-cmdcommand. For more information on thevmware-cmdcommand, see the VMware Scripting API documentation.
In vCenter Server, you may find that you have a virtual machine that has an orphan designation or has become invalid. An orphan virtual machine is one that exists in the vCenter Server database but is no longer present on the ESX host. A virtual machine also shows as orphaned if it exists on a different ESX host than the ESX host expected by vCenter Server.
A virtual machine can become orphaned in the below instances. For each instance, see the associated troubleshooting steps below:
- After a vMotion or VMware DRS Migration:
- After a VMware HA host failure occurs or after the ESX host comes out of maintenance mode:
- If you delete a virtual machine outside of vCenter Server.
- If vCenter Server is restarted while a migration is in progress, a virtual machine may show as orphaned.
- If you schedule too many virtual machines to be relocated at the same time.
- If the ESX/ESXi Host local disk in particular the root partition has become full, attempting to delete VMs may result in an orphaned VM.
- After a vMotion or VMware DRS Migration:
- Connect to the source and destination ESX/ESXi hosts using SSH. For more information, see Opening a command or shell prompt (1003892).
- Check with the
vmware-cmd -lcommand if the orphaned virtual machine is registered on the same ESX host as reported by vCenter Server, likely the source machine. If the virtual machine is not registered on that host, use thevmware-cmd -lcommand to check if it is registered on the destination ESX host.
Note: In ESXi, use thevim-cmd vmsvc/getallvmscommand instead of thevmware-cmd -lcommand.
If the virtual machine is registered on the destination ESX/ESXi host:
- Run these commands to restart the vpxa and ESX host management services:
service mgmt-vmware restart. For more information, see Virtual machines unexpectedly reboot after issuing the "mgmt-vmware restart" command (7301769).service vmware-vpxa restart.
Note: In ESXi, use the/sbin/services.shcommand to restart the management services on the host.
- Restart the vCenter Server Server Service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
- Run these commands to restart the vpxa and ESX host management services:
- For the majority of problems related to orphaned virtual machines on ESX/ESXi, these steps resolve the issue.
- Ensure that there is no time difference between the source and destination ESX/ESXi hosts.
A general system error occurred. The system returned on error. Communication with the virtual machine may have been interrupted.VMControl error -11: No such virtual machine.
Follow these steps to resolve the errors:
- Try to register the virtual machine through the
vmware-cmd -scommand.
Note: If it does not fail with the errorVMControl error -11: No such virtual machine, go to step 7.
You can also try to register a virtual machine by right-clicking on its.vmxfile in the datastore browser and choosing Register Guest. For more information, see Registering or adding a virtual machine to the inventory (1006160). - Try to start the virtual machine from the command line using:
vmware-cmd <cfg> start
where<cfg>is the path to the configuration file as determined byvmware-cmd –l.
Note: For more information about powering on a virtual machine on ESXi host using the command line, see Powering on an ESX/ESXi host's virtual machine (1003738).
- View the
.vmxfile of the virtual machine and verify that the file has valid configuration parameters. Ensure that the file does not contain non UTF-8 characters.
Note: If possible, compare the.vmxfile with the.vmxfile of another virtual machine.
- Create a new virtual machine, with the virtual disks of the original virtual machine.
- Power on the new virtual machine.
- Connect to the source and destination ESX/ESXi hosts using SSH. For more information, see Opening a command or shell prompt (1003892).
- After a VMware HA host failure occurs or after the ESX host comes out of maintenance mode:
- Remove the ESX host from vCenter Server:
- Select the specified ESX/ESXi host in the vCenter Server inventory.
- Right-click on the ESX/ESXi host and choose Disconnect.
- Right-click and select the Remove option after the ESX/ESXi host has been disconnected.
- Remove the vCenter Server agent and VMware HA agents by running the below commands from the service console of the ESX host:
export LGTO_AAM_VMWARE_REMOVAL=1
rpm -e LGTOaama
rpm -e LGTOaamvm
rpm -e VMware-vpxa
- Re-add the ESX/ESXi host to vCenter Server:
- Select the cluster, datacenter, or farm to which you want to add the ESX/ESXi host.
- Right-click the cluster, datacenter, or farm and choose Add.
- Enter the ESX/ESXi host's IP address. You must have a username and password with sufficient permissions to add the host.
- Complete the steps in the Add Host wizard.
Could not power VM, no swap file, failed to power on VM when trying to start them
Follow these steps:
- Run the
ps -auxwww | grep -i [vmname]command on each ESX host until you find the server host that is running the virtual machine's process and locking its files. - Run the
service vmware-vpxa restartcommand on that ESX host - Restart the VMware VirtualCenter Server service.
- Power off the virtual machine.
- Access the ESX/ESXi service console using an SSH client.
- Open the virtual machine configuration file (
.vmx) in a text editor.
Note: The default location is/vmfs/volumes/<datastore_name>/<vm_name>/<vm_name>.vmx - Remove the location of the swap file referenced in the configuration file. It should look similar to tis:
sched.swap.derivedName = ""
- Save the file.
- Rename or delete the existing swap file from the virtual machine directory.
- Unregister the virtual machine and register it back for the changes to take effect. For more information, see Registering or adding a virtual machine to the inventory (1006160).
- Power on the virtual machine.
- Remove the ESX host from vCenter Server:
- If you delete a virtual machine outside of vCenter Server.
A user can delete a virtual machine through the VMware Management Interface while vCenter Server is down, through the vSphere Client directly connected to an ESX/ESXi host, or by deleting the virtual machine's configuration file through the service console.
Note: If the configuration file was deleted and the virtual disk remains, you can recreate the virtual machine using the VMware Management Interface or the vSphere Client and choosing to attach the existing virtual disk to a newly created .vmx file.
- If vCenter Server is restarted while a migration is in progress, a virtual machine may show as orphaned.
This is a temporary situation. During start-up, vCenter Server reconnects to all hosts. If a migration completed while vCenter Server was down, a virtual machine can be reported as an orphan until vCenter Server establishes a connection to the target host for the virtual machine.
- If you schedule too many virtual machines to be relocated at the same time.
An ODBC timeout can cause errors in the database. To resolve an ODBC timeout, delete the orphans after ensuring the original virtual machines can power on. Click Delete VM on the vCenter Server console to delete the virtual machine and its orphan from the vCenter Server database.
- If the ESX/ESXi Host local disk in particular the root partition has become full, attempting to delete VMs may result in an orphaned VM.
This orphaned VM needs to be removed by right clicking the VM in the Inventory. For more information on correcting the host, see Investigating disk space on an ESX or ESXi host (1003564).
Additional Information
For further information on troubleshooting Orphaned VMs, such as recovering Orphaned Virtual Machines in the vSphere Client using a Relocate option, please reference the vSphere Troubleshooting Guide.
For more troubleshooting information, see Troubleshooting a failure to deploy or undeploy a virtual machine in VMware vCenter Lab Manager (1006336).
Tags
See Also
- Restarting the Management agents on an ESX or ESXi Server
- Investigating disk space on an ESX or ESXi host
- Powering on an ESX/ESXi host's virtual machine
- Opening a command or shell prompt
- Stopping, starting, or restarting vCenter services
- Registering or adding a virtual machine to the inventory
- Troubleshooting a failure to deploy or undeploy a virtual machine in VMware vCenter Lab Manager
- Virtual machines unexpectedly reboot after issuing the "mgmt-vmware restart" command
Update History
Request a Product Feature
- KB Article:
- Updated:
- Categories:
- Product Family:
- Products:
- Product Versions:

