How to find which virtual machines are restarted by an HA failover

You have been paged because an ESXi host is unreachable. The host had gone down due to a hardware error. Along with it, the host took down a couple of VMs. Thankfully, you have vSphere HA turned on in the cluster and HA restart all the impacted VMs on other hosts in cluster.

Should you want to get a list of impacted VMs, VMware has a KB article.

Find the master node.

In vSphere Client
– click on the cluser
– Summary
– vSphere HA
– click on Cluster Status

Then ssh to the master node.

To get a list of all HA restarted VMs with full path to vmx file

~ # grep VmRestartedByHAEvent /var/log/fdm.log  | awk '{print $3}' | grep vmx

To get a list of vmname.vmx files

~ # grep VmRestartedByHAEvent /var/log/fdm.log  | awk '{print $3}' | grep vmx |  awk -F/ '{print $6}'

To get a list of VM folders

~ # grep VmRestartedByHAEvent /var/log/fdm.log  | awk '{print $3}' | grep vmx |  awk -F/ '{print $5}'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s