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 show up as invalid or orphaned in these situations. To resolve these issues, see the troubleshooting steps provided for each situation:
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
Most of the time you can simply fix the issue by removing an orphaned virtual machine from the inventory and then re-adding it manually by re-registering. If this issue occurred due to unsuccessful host failover or when the virtual machine is unregistered directly on the host, you can fix the issue by migrating (of course cold) the affected VM to another host.
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
Referance: Vmware KB# 1003742, virten.net
That's it... :)
You saved my day. Thought I've lost my VM's
ReplyDeleteGood to know that it helped...👍
ReplyDelete