TeamCity Cloud 2022.12 Help

Agent Cloud Profile

A cloud profile is a collection of settings for TeamCity to start virtual machines with installed TeamCity agents on-demand while distributing a build queue. Configuring a cloud provider profile is one of the steps required to enable agent cloud integration between TeamCity and a cloud provider. The settings of profiles slightly vary depending on the cloud type.

Configuring Cloud Profile

Cloud profiles are configured in the Cloud Profiles section of the Project Settings.

Specifying Profile Settings

The following profile settings have to be provided:

Setting

Description

Profile name

Provide a name for the profile.

Description

Provide an optional profile description.

Cloud type

Select the cloud provider type from the drop-down menu.

Terminate instance idle time

Instruct TeamCity to stop a cloud agent machine using this setting and the Additional terminate conditions options. Specify the period (in minutes) for TeamCity to wait before stopping an idle build agent.
Leave empty for no timeout.

When a cloud agent is in maintenance mode, terminate conditions will not work. When you enable the cloud agent again, the settings will be applied.

Additional terminate conditions

  • After certain work time (minutes):
    Specify the working time (in minutes) for the agent after which the instance will be terminated. If the time elapses while a build is in progress, the agent will wait until the current build finishes.

  • On idle, close to an hour (minutes left to the end of hour):
    Specify how many minutes before the full hour an idle instance should be stopped: this allows avoiding charges for partial hours if your virtual machines are billed in whole hours, for example, when using Amazon EC2 instances.

  • After the first build:
    Select this option if you want TeamCity to stop the virtual machine immediately after the first build finishes. TeamCity will disable the build agents, and no more builds will be run on the same machine.

Next, you need to provide the cloud access information which will differ depending on the provider. After that, you can check the connection and add an image to be used as a source for TeamCity cloud agents.

You can limit the number of instances across all images in the cloud profile (Maximum instances count) and/or set the limit per image (in image settings).

Adding Agent Image

Click Add Image and configure the required options for the image.

You can specify which agent pool the agents should belong to. You can only select the pool that contains the current project and/or its subprojects. Pools containing projects other than the current one and its subprojects will not be available for assignment. If the selected agent pool is changed in the future so that the criteria are not met or if the agent pool is not specified, TeamCity will automatically assign the cloud agents to the project pool. You can also select the <Project pool> in the drop-down menu manually.
TeamCity automatically composes the project pool containing agents from all cloud profiles of the current project and all its subprojects. Thus, the added image will be available to all the subprojects as well. On the Agents | Pools page, this pool is marked as "<Project name> project pool". Project pools cannot be deleted or modified.

After an agent cloud profile is created with one or several sources for virtual machines, TeamCity does a test start for all the virtual machines specified in the profile to learn about the agents configured on them. Once agents are connected, TeamCity calculates their build configurations-to-agents compatibility and stores this information.

When a cloud profile is changed, TeamCity detects modifications immediately and forces shutdown of the agents started prior to these changes once the agents finish the current build.

Viewing Cloud Agent Information

The agents' information is displayed on the Agents | Cloud page under the <Profile name> drop-down menu.

Enabling/disabling Cloud Integration in Project

You can enable or disable integration for a project and/or its subprojects via the TeamCity web UI using the Change cloud integration status option on the Cloud Profiles page.

Last modified: 24 October 2022