HA error when upgrading ESXi 4.0 Update 2 to ESXi 4.1

Ran into this annoying HA error after upgrading some blades all running ESXi 4.0 Update 2.

All hosts were upgraded using VUM from a  vCenter 4.1 server. Upgrade all went well, taking only a few short minutes per host.

Upon trying to renable HA, all hosts failed with the error:

HA agent on esxhostname in cluster clustername in datacentername has an error:  Error while running health check script

Disabling HA on the cluster or reconfiguring HA on hosts had no effect. The error persisted.

From previous HA errors I remembered that this knowledge base article from VMware (KB1007234) might do the trick.

After enabling remote tech support mode (SSH) on the ESXi host and then connecting in;

Run the uninstall the Legato Automated Availability Manager script:

./opt/vmware/aam/VMware-aam-ha-uninstall.sh

Then restart management services on the ESXi host:

services.sh restart

Then re-enable HA on your cluster and it should install aam-ha agents from scratch on each ESXi host,

I’ve only run into this issue with ESXi and not ESX classic with COS,