vCenter Server task – Upgrade vCenter Agents on cluster hosts

One customer contacted me a week ago with a question regarding a vSphere vCenter Server problem they have seen after upgrading to vCenter Server version 5.1. I recall i had the same problem back in 2012 when upgrading to vSphere 5.1 and i thought it was worth to create a blog post about it, even though it is fixed in vCenter Server 5.0 Update 2 and vCenter Server 5.1 Update 1.
I will not share the information about why my customer do not run the latest available vCenter Server version and for how long time they have seen the problems described below.

Anyway, every time they restarts the vCenter ServerĀ It tries to upgrade the ESXi host vpxa agent even though it has already been upgraded to the latest version. The following task is shown in the vSphere web client Task Console and the task is never completed.
Screen Shot 2013-08-15 at 15.30.20
The vpxa agent is the software that makes it possible for the vCenter Server to manage the ESXi host. It is installed immediately when adding the ESXi host the the vCenter Server.

They also, not after every vCenter Server restart, experience that the ESXi hosts are disconnected when restarting the vCenter Server.
Screen Shot 2013-08-19 at 15.01.03

This problem occurs when the vCenter Server advanced setting “AgentUpgrade.autoUpgradeAgents” is configured to “false”

Screen Shot 2013-08-19 at 15.19.44

To solve the problem you need to change theĀ “AgentUpgrade.autoUpgradeAgents” parameter to use the “true” configuration. Mark the configuration option -> click Edit -> Mark the “Enabled” checkbox.
Screen Shot 2013-08-19 at 15.22.32
The result of the configuration is presented below.Screen Shot 2013-08-19 at 15.23.05

The ESXi hosts will not be disconnected the next time you restart the vCenter Server and the task “Upgrade vCenter Agents on cluster hosts” will complete immediately.
upgradehostcompletedThe second time you restart the vCenter Server after changing the configuration you will not see the task “Upgrade vCenter Agents on cluster hosts.

For additional information about the issue, see VMware KB 2016287