On this page:
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
Prior to TeamCity 2017.1, profiles are configured on the TeamCity | Administration | Agent Cloud page. In the later versions, cloud profiles are configured in the project settings allowing Project administrators to configure their own cloud profiles without bothering System administrators.
Specifying profile settings
The following profile settings have to be configured:
- The TeamCity server URL, which must be accessible to the build agent.
- The credentials to connect to the cloud provider.
Next you can instruct TeamCity to stop a cloud agent machine using the following options:
- Terminate instance idle time: Specify the period (in minutes) for TeamCity to wait before stopping an idle build agent. More than one build may run on the same virtual machine.
- Additional termination conditions:
- When idle, specify how many minutes are 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, e.g. Amazon EC2 instances (since TeamCity 2017.1).
- Terminate Instance:After first build finished: 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.
- After you check the connection, you need to add an image to be used as a source for TeamCity cloud agents.
Adding Agent Image
You need to configure the required options for the image.
Using the maximum instances number settings, you can limit a number of instances across all images (in the cloud profile) and /or set the limit per image (in image settings).
When configuring the image, it is possible to specify which agent pool the agents should belong to. Since TeamCity 2017.1, it is possible if the pool contains this project and/or its subprojects only. Pools containing projects other than the current one and its subprojects will not be available for assignment. If the assigned pool is changed in future so that the criteria is not met or if the agent pool is not specified, the cloud agents will be assigned to a special read-only pool containing only this project and its subprojects. The idea is to restrict the cloud agents pool only to a given project with its subprojects to track cloud costs by project.
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
Enabling/disabling Cloud Integration in Project
Since TeamCity 2017.1, it is possible to 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.