How to rename TeamCity Agent?

I have created new TeamCity Agent with some temporary name, which is stuck so whatever I do I cannot change it. The picture below illustrates what I'm talking about:

TC_AGENT1.png

That AZSC-TCTEST-2 name I want to change and cannot. I want the name AZSC-TCBUILD-1 for instance.

On the agent machine I have edited buildAgent.properties file like the following, but it does not change the name I see in TeamCity.

system.agent.name=AZSC-TCBUILD-1
teamcity.agent.name=AZSC-TCBUILD-1
system.azure.instance.name=AZSC-TCBUILD-1
azure.instance.name=AZSC-TCBUILD-1
teamcity.azure.instance.name=AZSC-TCBUILD-1
teamcity.agent.communicationProtocols=polling

Machine name where agent is running is also AZSC-TCBUILD-1.

Now this machine is actually VM running in Azure, but it should not be relevant because we don't use Cloud Agent plugin and don't have any Cloud Profiles configured. So we want to treat that machine as normal physical agent machine.

Some time in the past this machine WAS named AZSC-TCTEST-2, but it was renamed since then everywhere I could imagine, but for the life of me I cannot rename it in TeamCity.

I'm getting desperate! Please help!

Konstantin

4 comments
Comment actions Permalink

In agent log I see this:

[2015-10-18 11:27:26,473]   INFO - dAgentConfigurationInitializer - Loading build agent configuration from ..\conf\buildAgent.properties
[2015-10-18 11:27:26,989]   WARN - ds.azure.AzurePropertiesReader - Unable to set self port. Azure integration will experience problems
[2015-10-18 11:27:26,989]   INFO - ds.azure.AzurePropertiesReader - Added alternative address is set to  
[2015-10-18 11:27:27,005]   INFO - ds.azure.AzurePropertiesReader - Instance name and agent name are set to AZSC-TCTEST-2


So the agent detects that it is running on Azure, requests instance name from Azure and sends it as Agent name. We desperately need to be able to override that behavior, as there is no easy way to rename instances in Azure.

Konstantin
0
Comment actions Permalink

Hello Konstantin,

Please try to add the following line into the buildAgent.properties file:
name=AZSC-TCBUILD-1
and check that "name" parameter is present once in the file.

0
Comment actions Permalink

Oh yes, that's what I started with and it made no difference whatsoever. I think it is a bug in agent side Azure plugin - it should not modify agent properties unless agent was started by the server side Azure plugin. Now I wonder if there is any workaround.

azure.instance.name agent configuration parameter is stuck at the old name AZSC-TCTEST-2 and overrides everything. I wonder what can be done about it.

Konstantin

0
Comment actions Permalink

If someone faced with the same issue, please see the issue already submitted for the plugin in GitHub https://github.com/JetBrains/teamcity-azure-plugin/issues/17.
The workaround is suggested in it. The fix will be introduced in the nearest future.

0

Please sign in to leave a comment.