vSphere Cloud Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID vsphere-cloud Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
2.7 (archives)
Nov 20, 2015
credentials (version:1.15)
Source Code
Issue Tracking
Pull Requests
Open Issues
Pull Requests
Jason Swager (id: jswager)
Eric Lordahl (id: elordahl)
Usage Installations 2014-Nov 793
2014-Dec 802
2015-Jan 840
2015-Feb 855
2015-Mar 927
2015-Apr 919
2015-May 924
2015-Jun 1001
2015-Jul 982
2015-Aug 996
2015-Sep 1017
2015-Oct 1062

Add VMware vSphere support to Jenkins by making available multiple vSphere Build Steps and supporting the use of Virtual Machines as slaves.

vSphere Cloud Plugin

This plugin adds a way to control Virtual Machines hosted in a VMware vSphere server using Jenkins.  You can configure a Jenkins Slave to use a virtual machine, including an optional snapshot name.  If configured to do so, Jenkins will (optionally) revert, then start the virtual machine as a slave.  If configured to do so, Jenkins will also shutdown and (optionally) revert the virtual machine when all jobs have finished processing.

Additionally, you can manipulate your vSphere VMs & templates using any of the vSphere Build steps provided by this plugin.


vSphere Cloud Configuration

The first step is to configure Jenkins to know what vSphere server you will be using. To do this you need to add a new "Cloud" in the Jenkins "Configure System" menu.

Enter your vSphere host name (the name of the VMware vCenter); it usually has a format of https://host-name-or-IP-address You will also need to enter a display name for the vSphere cloud, a user name and password.  The user you enter will need to have power up/down and revert access to the virtual machines that will be used as slaves.  The Test Connection button will test to see if your vSphere is accessible with the specified host name, user name and password.

vSphere Slave Configuration


  • vSphere Cloud Instance: This is the name of the vSphere Cloud that you want to use.
  • Virtual Machine Name: The name of the virtual machine as it appears in vSphere.
  • Snapshot Name: (optional) the name of the snapshot to use.
  • Force VM Launch: Launches the virtual machine when necessary.
  • Wait for VMTools: Only useful if the virtual machine has VMTools installed; when enabled, it will wait until VMTools is running before continuing with the connection.
  • Delay between launch and boot complete: Number of seconds to delay after starting the virtual machine or waiting for VMTools before assuming the slave is operational.
  • (Not Shown) Disconnect after Limited Builds: Will force the slave agent to disconnect after the specified number of builds have been performed, triggering the disconnect action.
  • What to do when the slave is disconnected: Action to perform (Shutdown, Revert, Suspend, Reset, Nothing) when the slave is disconnected, either manually or via Jenkins.

Limited Builds

This feature - when enabled by using a value greater than 0 - will cause the slave to disconnect after the number of builds has been reached.  The disconnect action will be performed when the last build is completed.  

Build Steps

Build steps that jobs can use to interact directly with your vSphere instances.  Typical use cases have been added as build steps.  If you would like to see more functionality in this plugin, please open a ticket.

Clone VM from Template or VM

This build step will clone an existing Template or VM to a new VM. Linked clones are optional.  Cluster, Resource Pool, and Datastore can be specified.

Deploy VM from Template

This build step will create a VM from the specified template.  The template must have at least one snapshot before it can be cloned.  A linked clone may optionally be chosen.  The new VM will be placed in the same folder and storage device as the original template, and will use the specified ResourcePool and Cluster.

Convert VM to Template

This build step will mark the specified VM as a template. The VM must be powered down first, or the user must use the "force" option.

Convert Template to VM

This build step will convert a template into the VM. 

Delete VM

This build step will delete the specified VM.  At this time, templates will not be deleted by this build step.

As an additional precaution against accidental deletion, if the name or description associated with the vSphere Cloud changes after the Job has been saved, the job will need to be re-saved before it will function correctly.


Delete Snapshot

This build step will delete a snapshot, and optional allow consolidation of the disk.

Power-On / Resume VM

This build step will power on the specified VM and store the IP address in the "VSPHERE_IP" environment variable.   The build step will wait as long as specified in the "timeout" field (max 3600 seconds).  This build step will resume suspended VMs as well.

Power-Off VM

This build step will power off the specified VM.  There is an optional "Graceful shutdown", to attempt a shutdown via VMware Tools, if it's installed.

Reconfigure VM

This build step will allow selectively reconfiguration of the VM.  Available at this time are the following reconfigurations:

  • Edit CPU - change the number of cores and/or sockets.
  • Edit RAM - change the amount of RAM
  • Edit NIC - Add, edit or remove a NIC interface, specify label, MAC address and port group.
Rename Snapshot

This build step allows renaming of a snapshot.

Rename VM

This build step will allow renaming the VM

Suspend VM

This build step will suspend the specified VM. 

Revert to Snapshot

This build step will revert the specified VM to the specified snapshot.

Take Snapshot

This build step will take a snapshot of the specified VM using the specified Snapshot name, description, and whether or not to include memory in the snapshot. 

Delete a Snapshot

This build step will delete a specified snapshot from a specified VM. It will optionally consolidate all of the VM's disks.


Notes & Compatibility

  • In some cases, starting a VM might cause vSphere to prompt the user to answer a question regarding the copying or moving of a VM.  This plugin will use the default answer, which is "I copied it."
  • A great deal of thanks to the authors of the Lab Manager Plugin; their code was heavily copied to make this plugin.

This plugin is supposed to work in the following environments:

  • A licensed vCenter 4.0 and higher.  An evaluation license for vCenter should work.
  • A licensed ESX 4.0 or higher, or ESXi 4.0 or higher stand alone host.  
  • NOT TESTED, but should work in theory: VMware Server

This plugin will NOT work with the following VMWare products:

  • VMWare Player, Fusion, or Workstation (no remote APIs)
  • The free ESXi server (remote APIs only work for the vSphere Client)

Change Log

Version 2.7 (Nov, 20th, 2015)
  • Clone with resource pool: PR-33
Version 2.6 (June 10th, 2015)
  • Handle null GuestInfo during PowerOn via PR-31
  • Additional time outs during PowerOn via PR-32
Version 2.5 (May 18th, 2015)
  • HelpDoc: Set correct name for ip address variable via PR-27
  • ClusterFix: Don't assume that the cluster should exist via PR-28
  • SelectableCloud: Cloud should be selectable via PR-29
  • Logging: Log stack trace if exception message is null via PR-30

Version 2.4 (February 26th, 2015)

  •  Disconnect from vSphere after performing actions, contributed by ParagDoke via PR-26

 Version 2.3 (February 3rd, 2015)

  • Add build step for exposing GuestInfo.  Contributed by vorbis via PR-22
  • Get datastores directly from cluster. Contributed by vorbis via PR-23
  • VsphereSelection: Allow dynamic selection of vsphere cloud. Contributed by vorbis via PR-24
  • Optimization contributed by ParagDoke via PR-25
Version 2.2 (January 16th, 2015)
  • Contribute feature: Change/Add disk, by calj via PR-19
Version 2.1 (January 6th, 2015)
  • Fixes contributed by Oleg Nenashev in relation to  JENKINS-25588 
Version 2.0 (December 24th, 2014)
  •  Use Jenkins Credentials Plugin for username/password.  JENKINS-25588  Contributed by Oleg Nenashev
  • Fix for missing DataStores, contributed by calj
Version 1.1.12 (September 26th, 2014)
  • Possible fix for disconnect, shutdown, power on issue
  • Eric added some new VM actions:
    • Clone from template/VM
    • Rename VM
    • Rename Snapshot
    • Added Datastore name to Clone/Deploy
    • Added VM Reconfigure, to adjust CPU, RAM and NIC interfaces
Version 1.1.11 (July 8th, 2014)
  • JENKINS-21647: Allow deployment without a resource pool
  • Added a Graceful Shutdown to the Power Down build step
  • Additional fixes to handle multiple slave shutdowns and job runs on powered down slaves.
Version 1.1.10 (May 15th, 2014)
  • Modified the previous fix for preventing jobs running on slaves that had limited test runs enabled.  The original fix wasn't robust in terms of Jenkins restarts.
  • NOTE: A cleanup of the code revealed that the plugin was storing information in the slave configuration that it wasn't supposed to.  When this version of the plugin is installed, some old data may have been stored and Jenkins will note this on the Manage Jenkins page.  If the data is in regard to "isStarting" and "isDisconnecting", then it should be fine to delete that old data with no adverse effects.
Version 1.1.9 (May 12th, 2014)
  • Fixed problem where VM restarts due to limited test runs would result in the next build failing
Version 1.1.6 (April 25th, 2014)
  • Pull 12: from hrabbouh.  Added new disconnect options and an error case where disconnects were being called too many times.
Version 1.1.5 (March 13th, 2014)
  • JENKINS-22025: "VM cannot be started" repeatedly with vSphere plugin
  • JENKINS-21312: Vsphere plugin keeps reseting the slave when slave is configured for on demand start
Version 1.1.4 (January 30th, 2014)
  • When configuring a job, the "ServerName" drop-down now properly defaults to the saved value. (JENKINS-21580).
Version 1.1.3 (January 7th, 2014)
  • Add "Delete a Snapshot" build step (JENKINS-20793).
  • Update vijava dependency to 5.1.
Version 1.1.2 (November 26th, 2013)
  • Fixed a race-case type issue where Jenkins would disconnect a slave that was in the process of trying to connect.
Version 1.1.1 (November 6th, 2013)
  • Fixed an issue where certain exceptions, including those thrown during the initial connection to vSphere, were not logged to the console.
  • Adding "Resume" to "Power-On" build step title.
Version 1.1.0 (October 4th, 2013)
  • Condensed all vSphere build steps into a single "vSphere Build Step" container
  • Added more build steps; Made existing build steps more granular (JENKINS-19702)
    • Convert VM to a template
    • Convert template to a VM
    • Delete VM
    • Deploy VM from template
    • Power On VM
    • Power Off VM
    • Revert to Snapshot
    • Suspend VM
    • Take Snapshot
  • Deployment log now prints the name of created VM (JENKINS-19436)
  • Added configurable timeout to Power On Build Step
  • More code cleanup, restructuring, and refactoring
  • Due to the restructuring of classes, this plugin's job configurations won't survive the upgrade from 1.0.x to 1.1.0 or above.
Version 1.0.2 (August 28, 2013)
  • Massive code cleanup, restructure, and refactoring.
  • Help text has been overhauled to work better with Jenkins standards (localizable, linkable).
Version 1.0.1 (August 22, 2013)
  • Added build step functionality. The following build steps are now available: Create VM from Template, Convert VM to template, Convert template to VM, and Delete VM.
  • Minor behind-the-scenes code cleanup and re-factoring. 
Version 0.10 (May 25, 2012)
  • Fixed JENKINS-13722
  • Undid all the slave launching logic - the logic plus JENKINS-13735 was resulting in slaves that would never start.  Slave STILL never start in some cases, but once the Jenkins bug is fixed, it should begin working better.
Version 0.9 (May 7, 2012)
  • Overhaul of the slave launching logic.  Multiple slaves will be launched if unique.
  • Fixed JENKINS-17323 Log lines should print with new lines.
Version 0.8 (May 4, 2012)
  • Fixed JENKINS-13675 Fixed an NPE in some race cases involving slave startups
Version 0.7 (May 2, 2012)
  • Re-release due to problems in the release process.
Version 0.6 (release process failed)
  • Fixed JENKINS-12241 Test Connection fails if vSphere host contains trailing slash ('/') character
  • Fixed JENKINS-12163 Cleaning VM before start next job in queue.
  • Fixed JENKINS-13537 Not perform "revert snapshot" for all vmwares of a label
Version 0.5 (Dec 8, 2011)
  • Added "Reset" to the disconnect behavior.  Will do a Reset VM when the agent disconnects.
  • Added "Nothing" to the disconnect behavior.  Nothing at all will happen when the agent disconnects.
  • Updated the VM Java API to the latest version.
Version 0.4 (Oct 8, 2011)
  • Initial Release


plugin-cluster plugin-cluster Delete
plugin-slaves plugin-slaves Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment