Had a weird issue the other day with one of my ESXi hosts in my cluster. I was actually spinning up a new VM, and after I finished installing VMware Tools and all the usual nonsense I saw this error on the VM in VMware:
Virtual machine failed to become vSphere HA Protected and HA may not attempt to restart it after a failure.
I checked the ESXi host that was running the VM and saw the following error:
vSphere HA agent for host <Hostname> has an error in <Cluster Name> in <Datacenter Name>: vSphere HA agent cannot be installed or configured.
I did some searching on the internet and found some people suggesting to restart the management agents on the host and select the “Reconfigure for vSphere HA” option in the right click menu. I tried both of those to no success. I then vMotioned all the VM’s off of the host and restarted it. Still no dice. I vMotioned everything back, ripped our HA config off of the cluster, and reconfigured it with a few quality of life changes. That did the trick! Probably just a fluke, but it was weird one to say the least.