I've found a partial solution, at least. I installed the Groovy Post-build plugin and for every job add a Groovy script: manager.build.getBuiltOn().toComputer.setTemporarilyOffline(true)
-- Sami Sami Tikka kirjoitti 11.6.2012 kello 21.24: > Can I pick your brains for a moment? I have suddenly developed a need > to make sure my slaves (libvirt vms) are clean when running test jobs. > > My initial idea was to use jenkins cli to take a node offline during a > test run to prevent it from accepting more work (my slaves all have > just 1 executor) and then using parameterized trigger to run a job on > the master that would recreate the slave vm. > > Unfortunately these test slaves run in a network with limited access > due to company security policies. The slaves are not able to e.g. > connect to the master. I believe this prevents me from using the > jenkins cli in the slave. > > Is there another way I can make a slave take only 1 build, execute it > and not pick up more work? > > I saw the "Offline node on failure" plugin, which seemed promising, > but it seems to take a node offline only when a build fails. The > libvirt cloud plugin sets up a new libvirt slave type, but as far as I > can see it does not provide a way to recreate the slave after every > build or revert to a clean snapshot. > > Any ideas? > > -- Sami