Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container Instance Agent Resource Group mix up fails instance stop #133

Open
BC-atJG opened this issue Feb 18, 2022 · 0 comments
Open

Container Instance Agent Resource Group mix up fails instance stop #133

BC-atJG opened this issue Feb 18, 2022 · 0 comments

Comments

@BC-atJG
Copy link

BC-atJG commented Feb 18, 2022

Description

I defined an Azure Resource Manager Cloud Profile and configured an Agent Image using the DockerHub image spec'd as (with the other settings not relevant to this issue):

  • Deployment: New resource group
  • Image Type: Container
  • Docker Image: jetbrains/teamcity-agent
  • Name Prefix: tc-agent

Within Azure, these resources were created (see attached image, 1-Initial-Resource-Group):

  1. A Resource Group, named tc-agent
  2. A Container Instance, named tc-agent1 within that Resource Group

1-Initial-Resource-Group

When left to idle-out, or if I manually stop it within the Agent Pool, it fails to stop with the following error.
Failed to delete resource group tc-agent1: Resource group 'tc-agent1' could not be found. (see attached image, 2-Stop-Fail)
2-Stop-Fail

I had to create a Resource Group with the name tc-agent1, which allowed TeamCity to complete its stop. That action deleted the newly/manually created tc-agent1 Resource Group, but left the original tc-agent Resource Group intact, with the Container Instance still running within.

Then, TeamCity either started up the Agent again, or recognized it was still running, which put me in a bad loop until I deleted the Agent Image definition and cleaned up Azure resources.

It appears that the upon initial deploy, the Resource Group created used the prefix as its name and allocates an agent with a numerical increment appended to the prefix for a name. Then, upon termination, an easy clean up using Resource Group deletion is made expecting that the Resource Group name is the same as the Agent instance name, which it is not.

If I had my choice, I would prefer to have a single Resource Group in which all resources for the Agent Image definition are placed, then have the stop not perform a Resource Group deletion, but only a deletion of the Container Instance (and the networkProfile) which got created. This is much preferred over using separate Resource Groups for each Container Instance which is spun up.

Environment

  • TeamCity version: TeamCity Enterprise 2021.1.1 (build 92714)
  • Azure plugin version: 0.9.8

Diagnostic logs

None provide for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant