Deallocating TC Azure Agent VMs when not in use.

We have a fairly time consuming process for the provisioning of a new TC Agent VM. Disk snapshots need to be applied and this takes time. Some of the agents have quite high SKUs and are therefore fairly costly to leave running when not in use.

It would be beneficial if we could adjust our build steps to leave the agent VM in the Deallocated state after the build has finished with it. The steps would change the state to 'Started' as the first step.

This would bring the dual benefits of a) allowing fully-provisioned agent VMs to be set to be dormant and b) reducing costs by deallocating the agent VMs when not in use.

Please could you advise how this could be achieved with TeamCity. Is there a plugin available that would allow us to manipulate the agent via the build steps?

We ideally need to intercept the process just after an agent has been selected from the pool.

Note that the TC agents are in the form of individual instances in an Azure scale set.

 

0

Please sign in to leave a comment.