1
votes

Visual Studio Online does not queue in my private agent pool and defaults to the Hosted pool instead

I have a private build agent installed on my local machine in a Linux container, running against an agent pool, "MyBuildPool", on VSTS/Visual Studio Online.

The agent is online (up and running) on VSTS web portal (SUCCESS!)

When I queue a build, I select my build pool "MyBuildPool".

For diagnostic purposes, I have a demand in place to find the Agent.Name (which is the hash of the container i.e. c5f5044d043a) (Note: If I remove the demand, I get the same incorrect behaviour)

VSTS insists upon queueing my build on the Hosted pool! (FAIL!)

Any ideas?

Many Thanks

No agent found in pool **Hosted** which satisfies the specified demands:
     Agent.Name -equals c5f5044d043a
     Agent.Version -gtVersion 2.115.0 
2
What does your build definition look like? Can you post the JSON (or YAML, if it's a YAML build)?Daniel Mann

2 Answers

0
votes

This one was due to my own confusion!

The build agent was configured in two places!
- On the Build Pipeline node of the build definition - On the first Agent Job! This is the one I missed.

When I created the build definition, I used an "empty" build template. I am not used to configuring the agent pool at both levels.

This can be confusing when you click "Queue" a new build, and you are asked to select an agent pool. Once you have selected it, it is very confusing when the build agent job task grouping comes along and overrides what you have just configured!

Answer: Check the Pipeline node, as well as each of the the Build Agent jobs you have configured. to ensure that you have specified the agent pool correctly.

0
votes

In my case, I had added the system variable VSTS_HTTP_TIMEOUT and VSTS_HTTP_RETRY in agent machine and it started failing with the above error.

After removing the above system variable from my VSTS agent machine, and restarting the machine, started working fine.