locked
Build Agent Name and Tags, match exactly not working RRS feed

  • Question

  • I am having issues with builds running on the wrong agent. I have a build definition with the Agent Settings set to "Use agent where Name=labpcstbuild01 and Tags is empty; Max Wait Time: 04:00:00". Unless I'm missing something really basic, this should use the agent named labpcstbuild01 to run everything within the agent scope of the workflow, right?

    In the build log, what I see is this: AgentScope (reserved build agent dfwbuildpos on dfwtcbuild10.2)

    Of course the problem is that this build agent is not capable of doing this build, and a little ways into the Agent Scope the build fails. Why in the world is it not using the build agent I specified?

    I have also had other build definitions which require tags to be matched exactly run on a build agent with no tags at all.

    This seems very basic, and I feel I must be missing something. The alternative scares me a little bit.

    Thursday, May 24, 2012 6:47 PM

Answers

  • Yes, the default template declares the input parameter for the agent reservation spec and then binds the InArgument<AgentReservationSpec> to that input. If you are just taking the default, this is why they are not matching.

    Patrick

    Friday, May 25, 2012 3:32 PM

All replies

  • What version of TFS are you using?

    Patrick

    Thursday, May 24, 2012 7:11 PM
  • 2010
    Friday, May 25, 2012 12:54 PM
  • Are you using one of the OOB templates, such as DefaultTemplate.xaml, or is this a custom workflow template?

    Patrick

    Friday, May 25, 2012 1:47 PM
  • It's a custom workflow template, modeled loosely on the default template. I created it by adding many of the same activities from the toolbox instead making a copy and making heavy modifications.

    I notice that the defaults for some arguments are not the same as they are in the activity on the default template. In particular, I'm looking the the Run On Agent/AgentScope activity. The timeouts on the default template use the constant "AgentSettings.MaxWaitTime", while the one I dragged from the toolbox has "New System.TimeSpan(0, 0, 0)". Also, the ReservationSpec has "AgentSettings.GetAgentReservationSpec()" where I have "New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentReservationSpec()".

     This looks like it might be my problem...

    And yes, it is. Sigh. I guess I need to double check everything else. I'm doing this template from scratch specifically to learn how all this works, so I guess the adage that you learn from failure, not success applies here. I was thinking of the AgentScope activity a more of a simple container, so I never really looked at the properties.

    Thanks for making me think of the possibilities.

    Friday, May 25, 2012 2:35 PM
  • Yes, the default template declares the input parameter for the agent reservation spec and then binds the InArgument<AgentReservationSpec> to that input. If you are just taking the default, this is why they are not matching.

    Patrick

    Friday, May 25, 2012 3:32 PM
  • I wish I'd found this post last week!  I have been banging my head off my desk trying to figure out why a from-scratch build template I've been using has been ignoring the agent spec settings I put in the associated build definition.
    Wednesday, March 11, 2015 2:54 PM