From somebody on expertsexchange
There are 2 main reasons cause the problem
1. DNS name issue
2.vcenter build version is not match the ESXi build version
Please following these steps to fix the problem, it’s my own notes, fixes all the 3 causes
Failed to enable HA agent on an ESXi host
1.Try to disable HA on Cluster level, by right click ‘clusterX’, edit setting. Uncheck HA and DRS.
2.Waiting for disabling HA tasks completed for all hosts.
3.Back to cluster “edit setting”, check only ‘enable HA’, click ok. It takes a few minutes to get all ESXi hosts on cluster have HA agent installed.
4.Then enable DRS.
5.If one or more ESXi host HA agent is not started. Right click the failed host, “reconfigure for HA agent”
6.If the problem still not get fixed. Disconnect the ESXi host, link through SSH, run the following to uninstall HA agent on host
7./opt/vmware/uninstallers/VMware-vpxa-uninstall.sh & /opt/vmware/uninstallers/VMware-aam-ha-uninstall.sh , restart vm management services by /sbin/services.sh –restart
8.Then reconnect ESXi on vcente, vcenter will push a new version of HAagent installation.