Add script based slave VM management to Jenkins to use virtual machines as slaves


This plugin adds to the Jenkins CI a way to control virtual machines through scripts. It takes two scripts: one for starting

NOTE: A great deal of thanks to the authors of the vshpere cloud Plugin; their
code was heavily copied to make this plugin.


scripted Cloud Configuration

The first step is to add a new "Cloud" in the Jenkins "Configure System" menu based on "scripted Cloud". Enter its description, start and stop scripts.

Start script: This is called while launching slave of this cloud. Its expected that this script ensures that VM is up and running. Configure the slave configuration on VM such that it connects to master automatically on start. For this setup slave by options: Java web start or add a startup script on slave to connect to master.

Stop script: This is called after the job has finished after all post-build steps.

You can pass parameters to these scripts in the text box, e.g. my_startup_script param1 param2 ...

Various environment variables are passed to these scripts as mentioned next section.

scripted Slave Configuration

Select "Slave virtual computer running under scripted Cloud" while creating node. Following screen shot shows node configuration.

Here is description of important inputs. The test enclosed brackets after input name is the environment variable exposed to selected scripted-cloud start/stop scripts.

You can just check what all environment variables are available to start/stop script by adding "set" or "env" command in start/stop scripts. Environment variables set by this plugin starts with "SCVM".

Scripted cloud scripts mentioned by user can use these variables in any way. Plugin just assumes that VM slave is ready and connected when start script ends.

Developer Notes

I have following basic scenarios successfully:

Planning to remove following configuration :

Change Log

Version 0.1 (May 25, 2102)