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
Dependencies
1.1.5
Mar 13, 2014
1.504
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Jason Swager (id: jswager)
Eric Lordahl (id: elordahl)
Usage Installations 2013-Apr 340
2013-May 382
2013-Jun 395
2013-Jul 406
2013-Aug 417
2013-Sep 437
2013-Oct 453
2013-Nov 501
2013-Dec 495
2014-Jan 520
2014-Feb 545
2014-Mar 586

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.

Configuration

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.

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.

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.

WARNING: THIS IS A DESTRUCTIVE OPERATION THAT WILL DELETE THE VIRTUAL MACHINE WITHOUT ADDITIONAL CONFIRMATION.  IT CANNOT BE UNDONE.

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. 

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.

WARNING: THIS IS A DESTRUCTIVE OPERATION THAT WILL DELETE THE SNAPSHOT WITHOUT ADDITIONAL CONFIRMATION.  IT CANNOT BE UNDONE.

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 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

Labels

Edit
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