Reputation: 93
I have a pool with 10 agents. I have noticed that usually only some of them are used, and others still there have hardly ever been used.
I am wondering if is there a way to say to TFS to use all of them? For example, something like TFS grabs them based on the order. At the first time uses the number 1, then 2, 3. After using the agent it puts the agent to the end of the queue. So, before using number 1 again TFS would use all the numbers first.
That would be very good to have that logic in place to have the best use of all the agents we have in place.
Upvotes: 9
Views: 6598
Reputation: 1817
I wondered about the same thing. The cleanup process seems to leave artefacts from time to time. With the amount of builds we run, the servers tend to get low on space eventually (even though we wrote our own cleanup utilities).
It seems that there is a method to the TFS madness: VSTS Build Agent Selection Demystified
After discussing this with some folks at Microsoft, it turns out that the selection routine works something like this – when a new build is queued:
- Select all build agents that match the specified demands
- Sort the results by the clustered index on agent name
Translation: The build agents are selected in the same order in which they were registered with VSTS. I suppose that’s a simple approach, but not the one that I was expecting.
Upvotes: 4
Reputation: 30442
Just as Daniel said, they don't need to be rotated. If some of them are not required, you can get rid of them.
However, you can set Demands
in your build definition if you want to use a specific agent every time.
In the build definition, under General, add the Demand Agent.Name and set it equal to the name of the build agent under the value column, or add the custom demands (for example, use USER CAPABILITIES) to identify the specific agent. This will ensure the build is serviced by only this agent.
So, you can create different build definitions to use each of the agents.
Please reference this article for details: Build vNext, distributing load to different agents.
However, we can not achieve that for now. There is a user voice request here for the feature. You can go and vote it up to achieve it in the future.
Upvotes: 8