First, decide on a label and assign it to all the slaves that you’d like to group together. For example, you can use the hypervisor host name as a label, and put that label on all the slaves that are the virtual machines on that host. This can be done from the slave configuration page as shown in Figure 6.2, “Set appropriate label on the slave configuration page”.
Then click the newly entered label to jump to the label page as show in Figure 6.3, “Go to the labels page”.
Then configure this label and enter the limit as shown in Figure 6.4, “Set limit on the hypervisor”.
With this setting, as you can see, the total number of concurrent builds on hypervisor1
is limited to 2, and Jenkins Enterprise will enforce this as you can see in the executor state in Figure 6.5, “Label Throttle Build plugin in action”. Two builds are already running, so the third job sits in the queue.