VMware cloud profile - "Disconnected — Agent has unregistered (will upgrade)"

Hi, we recently started using cloud profiles with VMware to spawn agents on demand.

Everything is working fine, but we are seeing a lot of agents in the the “Unauthorized” section of the agents tab:

It pollutes the view and makes it harder to spot the actual disconnected agent. It seems that the agent software in the VM template is older than the TC version.

Is there a way to stop this “spam” without needing to update agent software in the template? 

0
5 comments

Hi Jakub,

You are seeing many “Unauthorized” agents in TeamCity because the agent software in your VM template is older than the TeamCity server version. When a new VM is spawned, the old agent tries to connect, but since it’s outdated, it cannot register and ends up in the Unauthorized/Disconnected list. This is a common issue when using VM templates for dynamic agent provisioning.
 

> Is there a way to stop this “spam” without needing to update agent software in the template?
 

Short answer: no, there is no fully supported way to stop this agent spam without updating the agent software in your VM template.

TeamCity expects the agent version to match (or be compatible with) the server. When it’s not, the agent cannot register and will always show up as unauthorized/disconnected.

For more detailed information, please refer to the official documentation: Upgrading TeamCity Server and Agents.

You can periodically remove unauthorized agents using the UI or the REST API:  Managing Agents via REST API
I also recommend updating your VM template after upgrading the TeamCity server version to ensure consistency with the latest environment.

Best Regards,
Tom

0

Thanks! We will do that 

0

Hi again, 

actually the problem is not that agent version is not the same as the servers version. Even with the same version when the agent connects to the server for the first time, it gets a lot of zip files and unpacks it, then it restarts. The server sends a new agent name and then its visible as per cloud agent naming convention. 

Is there a way to pre-load agent with all the needed zip files so that it connects immediately without restarting when it connects for the first time?

0

Hi,

> Is there a way to pre-load agent with all the needed zip files so that it connects immediately without restarting when it connects for the first time?

You are correct — even when the TeamCity server and agent versions are the same, a freshly connected agent will still download a set of distribution ZIP files (plugins, tools, and internal components) from the server on the first connection. After unpacking these files, the agent performs a mandatory restart, and only then reconnects with the final agent name assigned by the server (for example, following the cloud agent naming convention). This behavior is expected and is not related to a version mismatch.

At the moment, TeamCity does not provide a supported way to fully pre-load or pre-bake all required agent ZIPs so that the agent can skip this initial synchronization and restart entirely. The reason is that the server dynamically determines which components must be deployed to the agent based on the current server state (plugins, bundled tools, compatibility updates, etc.), and this logic is intentionally centralized on the server side.

That said, there are a couple of practical approaches you may consider to reduce the impact:

Pre-bake agents after a warm start

You can start an agent once, let it fully connect, download all required files, restart, and then create your VM/image/container snapshot from this “warmed-up” state. Agents created from this image will already have most of the required files locally, which usually reduces startup time. However, please note that a restart may still occur if the server detects any differences (for example, after plugin updates).

Avoid frequent server-side changes

Changes such as installing/updating plugins or upgrading the TeamCity server will trigger agent-side updates again. Keeping these changes infrequent helps minimize repeated restarts for newly created agents.

In summary, while the initial restart on first connection cannot be completely avoided, pre-warming agent images is the closest supported workaround to achieve faster agent availability.

0

Thanks, that is a suitable workaround as our server side things don't change so often.

0

Please sign in to leave a comment.