title: Jenkins Build Distribution among Slaves
body: <p>I need to get some advice about the way to control the way Jenkins Slaves are used / Jobs are being triggered.</p>
  
  <p>Background / Constraints:</p>
  
  <ol>
  <li><p>I have a sequence of 10 jobs that run one after each other using the <strong><em>"Trigger parameterized build on other projects"</em></strong> option <a href="https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin" rel="nofollow">Parameterized Trigger</a> Plugin.</p></li>
  <li><p>Each Build of these jobs must run on the same node (I am doing it by using <strong><em>"Build on the same node"</em></strong> which is also configured in the parameterized build plugin and comes from the <a href="https://wiki.jenkins-ci.org/display/JENKINS/NodeLabel+Parameter+Plugin" rel="nofollow">NodeLabel</a> Plugin).</p></li>
  <li><p>I have 5 Slaves (current number of executors per slave is 1 but i am open for suggestions here...)</p></li>
  <li><p>Once Slave is occupied by a Build Sequence, no other job can run on it. When I had only 1 slave, the way I enforced it was using the <strong><em>"Block build when downstream project is building"</em></strong> </p></li>
  <li><p>The way I configured the slave to be chosen when the first Job is triggered is one of the following: (None of them solved my problem)</p>
  
  <p>a. Using the <strong><em>"Restrict where this project can be run"</em></strong> and put there a label that all relevant slaves will point to.</p>
  
  <p>b. Using the option of "This build is parameterized" (<a href="https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin" rel="nofollow">Parameterized Trigger</a> Plugin) and then add a <strong><em>"Node"</em></strong> parameter with the list of Slaves that the User can choose from.</p></li>
  </ol>
  
  <p><strong>What I want to achieve?</strong></p>
  
  <ul>
  <li><p>When a User triger the build of the First Job in the Build Sequence, this Build will be done on once of the idle Slaves. (I mean a slave that is doing nothing at the moment)</p></li>
  <li><p>If there are no idle slaves, then it will join a queue of one of them (doesn't matter which)</p></li>
  </ul>
  
  <p>Any suggestions how to solve it?</p>
  
  <p><strong>Thanks!</strong></p>