Virtual machines appear as invalid or orphaned in vCenter Server
Symptoms
Resolution
- 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
- Virtual Machines show as invalid or orphaned after a storage failure
- Virtual Machines show as invalid or orphaned after the connection is lost between the vCenter Server and the host where the virtual machine resides
- 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
- In C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd.log file, you see entries similar to:
[11916 error 'vpxdvpxdVmomi'] [SoapInitWritelocked] GetVpxaInfo failed for host esxi01.domain.com
[11916 info 'vpxdvpxdVmomi' opID=HB-host-01@3777-1a2b429b] [SoapInitWritelocked] Attempting to get Vpxa version for host esxi01.domain.com
[10060 warning 'Default' opID=HB-host-01@3777-1a2b429b] Closing Response processing in unexpected state: 3
[11916 info 'vpxdvpxdHostAccess'] [VpxdHostAccess] Failed to get VpxaCnxInfo over SOAP version vpxapi.version.version1 for host esxi01.domain.com:Invalid response code: 503 Service Unavailable
Note: The preceding log excerpt are only examples. Date, time, and environmental varibales may vary depending on your environment.
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:
A virtual machine can show up as invalid or orphaned in these situations. To resolve these issues, see the troubleshooting steps provided for each situation:
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. These virtual machines can be removed from the vCenter Server by right-clicking the virtual machine and selecting delete. If the delete option is not available, see Deleting an orphaned virtual machine when the Remove option is not available (1011468).
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.
An ODBC timeout can cause errors in the database. To resolve an ODBC timeout:
For more information on correcting the host, see Investigating disk space on an ESX or ESXi host (1003564).
For more information, see Virtual machines are orphaned after rebooting the ESXi host on which they reside (2013301).
- Before you begin, see Restarting the Management agents on an ESX or ESXi host (1003490) for important information on restarting the mgmt-vmware service.
- These solutions may require the use of the vmware-cmd command. For more information on the vmware-cmd command, see the VMware Scripting API documentation.
A virtual machine can show up as invalid or orphaned in these situations. To resolve these issues, see the troubleshooting steps provided for each situation:
- After a vMotion or VMware DRS migration
- After a VMware HA host failure occurs, or after the ESX host comes out of maintenance mode
- A virtual machine is deleted outside of vCenter Server
- vCenter Server is restarted while a migration is in progress
- Too many virtual machines are scheduled to be relocated at the same time
- Attempting to delete virtual machines when an ESX/ESXi host local disk (particularly the root partition) has become full
- Rebooting the host within 1 hour of moving or powering on virtual machines
- A .vmx file contains special characters or incomplete line item entries
- Reload all invalid virtual machines on a single host at one time
- vCenter database is full
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).
- Using the vmware-cmd -l command, check if the orphaned virtual machine is registered on the same ESX host as reported by vCenter Server, which is likely the source machine. If the virtual machine is not registered on that host, use the vmware-cmd -l command to check if it is registered on the destination ESX host.
Note: In ESXi, use the vim-cmd vmsvc/getallvms command instead of the vmware-cmd -l command. - 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.sh command 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.
- Try to register the virtual machine using the vmware-cmd -s command.
Note: If the command does not fail with the VMControl error -11: No such virtual machine error, go to step 5.
You can also try to register the virtual machine by right-clicking on its .vmx file in the datastore browser and choosing Register Guest.
For more information, see Registering or adding a virtual machine to the inventory on vCenter Server or on an ESX/ESXi host (1006160). - Try to start the virtual machine from the command line using:
vmware-cmd config_path start
Where config_path is the path to the configuration file as determined by vmware-cmd –l.
For more information about powering on a virtual machine on an ESXi host using the command line, see Powering on an ESX/ESXi host's virtual machine (1003738). - View the virtual machine's .vmx file and verify that the file has valid configuration parameters. Also ensure that the file contains only UTF-8 characters.
Note: If possible, compare the .vmx file with the .vmx file of another virtual machine. - Create a new virtual machine using the virtual disks of the original virtual machine.
- Power on the new virtual machine.
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 select Disconnect.
- After the ESX/ESXi host is disconnected, right-click the host again and select Remove.
- Remove the vCenter Server agent and VMware HA agents by running these 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
- Run the ps -auxwww | grep -i vm_name command on each ESX host until you find the server host that is running the virtual machine's process and locking its files.
Note: For ESXi the command is:
ps | grep vmx - Run the service vmware-vpxa restart command 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's configuration file (.vmx) using a text editor. 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 looks similar to:
sched.swap.derivedName = "" - Save the file.
- Rename or delete the existing swap file from the virtual machine directory.
- Unregister the virtual machine and re-register it for the changes to take effect. For more information, see Registering or adding a virtual machine to the inventory on vCenter Server or on an ESX/ESXi host (1006160).
- Power on the virtual machine.
A virtual machine is deleted 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. These virtual machines can be removed from the vCenter Server by right-clicking the virtual machine and selecting delete. If the delete option is not available, see Deleting an orphaned virtual machine when the Remove option is not available (1011468).
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.
vCenter Server is restarted while a migration is in progress
This is a temporary situation. During startup, vCenter Server reconnects to all hosts. If a migration is completed while vCenter Server is down, a virtual machine can be reported as an orphan until vCenter Server establishes a connection to the virtual machine's target host.Too many virtual machines are scheduled 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 DeleteVM on the vCenter Server console to delete the virtual machine and its orphan from the vCenter Server database.
Attempting to delete virtual machines when an ESX/ESXi host local disk (particularly the root partition) has become full
The orphaned virtual machine must be removed by right-clicking the virtual machine in the Inventory.For more information on correcting the host, see Investigating disk space on an ESX or ESXi host (1003564).
Rebooting the host within 1 hour of moving or powering on virtual machines
If the host is rebooted within an hour after the virtual machines are moved or powered on, the vmInventory.xml file does not persist and hostd does not report these virtual machines as registered on the host. In an HA-enabled cluster, this condition impacts only the virtual machines with HA restart disabled.For more information, see Virtual machines are orphaned after rebooting the ESXi host on which they reside (2013301).
A .vmx file contains special characters or incomplete line item entries
Using a text viewer, view the contents of the .vmx file. If any lines appear incomplete or contain trailing spaces or special characters:- Make a backup copy of the .vmx file.
- Using a text editor, delete the partial lines and/or remove any trailing spaces or special characters.
- In vCenter, right-click on the virtual machine and click Remove From Inventory.
- In vCenter Server, browse the datastore and find the .vmx for the virtual machine.
- Right-click on the virtual machine and click Add to Inventory.
Reload all invalid virtual machines on a single host at one time
This script reloads all invalid virtual machines on a single host at once:
for a in $(vim-cmd vmsvc/getallvms 2>&1 |grep invalid |awk '{print $4}'|cut -d \' -f2);do vim-cmd vmsvc/reload $a;done
To resolve this issue, manually purge or truncate the vCenter Server database.Purging old data from the database used by vCenter Server (1025914)
leliaXtranwa Julie Black https://wakelet.com/wake/UvN-on4aY4_8tamd8HDb2
ReplyDeletepierenmapa
crucadit-saSavannah Lisa Burns VMware Workstation
ReplyDeleteFastStone Capture
Autodesk Maya
hillspiradne
terfir0tua-e Carol Collins Click here
ReplyDeleteAwesome
tadartestda