Newly deployed ESXi host fails to install/configure vSphere HA agent.
The below errors are seen on the host's summary tab in vSphere client:
"vSphere HA agent for this host has an error: vSphere HA agent cannot be installed or configured."
"vSphere HA cannot be configured on this host because there are no mounted datastores."
"No datastores have been configured."
VMware vSphere ESXi 8.x
This issue occurs when there are no datastores configured/mounted on the host.
vSphere HA uses datastore heartbeating to distinguish between hosts that have failed and hosts that reside on a network partition.
With datastore heartbeating, vSphere HA can monitor hosts when a management network partition occurs and continue to respond to failures.
To resolve this issue:
Other possible issues which can trigger this alert: