Child pages
  • Openstack Cloud Plugin
Skip to end of metadata
Go to start of metadata
Provision nodes from OpenStack on demand.

Plugin Information

View Openstack Cloud on the plugin site for more information.


In order to provision new nodes when Jenkins load goes high, administrator needs to configure Cloud and one or more Templates on global configuration page. Cloud represents connection to particular OpenStack tenant (project). In order to use several openstack instances or tenants, it is necessary to configure several Clouds in Jenkins. Template can be seen as a definition of particular kind of node. Template is the primary holder of all the attributes for OpenStack machine to be provisioned (image, flavor, etc.) as well as for Jenkins node (number of executors, etc.). Note that the same set of attributes can be configured on Cloud level as well. Such configuration will be then used as default for its templates. For example, if all nodes are supposed to use the same key-pair there is no need to state it in every template, it can be configured on cloud level and leave the filed blank in the templates.

Aside from machine/node attributes, every template require name and labels to be configured. Name will serve both as an identifier of the template as well as a name prefix for Jenkins node and OpenStack machine (that is why some limitations apply here). Labels field expects a set of Jenkins labels that will be assigned to all nodes given template provision. It will also be used to determine which cloud and template to use to process Jenkins load. When there is a build with no label requirements (Restrict where this project can be run on job page), any template can be used to provision the node. Build with label restriction can trigger provisioning only on templates with matching label set. The attributes at template level will inherit all global values (the value in effect is printed under the field). In case required field do not have a default nor current value, it will be reported.

User data

Every template can declare user-data script to be passed to CloudInit to customize the machine that is provisioned. Note that the image needs to support cloud init explicitly.

Before the script is sent to OpenStack, plugin injects several values using ${VARIABLE_NAME} syntax:

  • JENKINS_URL: The URL of the Jenkins instance
  • SLAVE_JAR_URL: URL of the slave.jar - the agent executable
  • SLAVE_JNLP_URL: The endpoint URL for JNLP connection
  • SLAVE_LABELS: Labels of the corresponding Jenkins computer


Openstack plugin utilizes Cloud Statistics Plugin that captures failures and time trends of past provisioning attempts.

Tips and tricks

  • User can manually provision slave from particular cloud/template on Manage Jenkins > Manage Nodes.
  • Deleting slave provisioned by OpenStack plugin will merely put it temporarily offline, the actual disposal of the slave and machine is performed with delay. That means that user have the possibility to abort that operation putting the slave back online. But most importantly, user can suggest plugin to discard the slave while still occupied by running build this way.
  • Plugin identifies OpenStack image/snapshot to provision by its name. The image can be updated/replaced in openstack and the plugin will not require update provided its name have not changed.
  • In case maximal instance number is specified on template level, the stricter of the two (global and template value) will be applied. Global value exists to ensure that the number of machines provisioned by plugin will not exceed certain limit. The template value can further restrict that at most N machines of given kind can be utilized at the same time.
  • Plugin can report maximal number of instances was reached while there is not adequate number of Jenkins nodes. It is because plugin inspects running OpenStack machines in order to cover machines being provisioned/deleted (that do not have Jenkins nodes) and instances that plugin failed to delete. In case the instance get leaked, please report that as a bug with all relevant FINE level logs attached.
  • On every slave provisioned by the plugin, there is an environment variable OPENSTACK_PUBLIC_IP declared with the IP address allocated for the machine.


Accessing logs

Plugin uses INFO and above levels to report things user should worry about. For debugging, set it to FINEST - note the ALL level is not sufficient to print these. To configure OpenStack plugin logging in Jenkins UI go to Manage Jenkins > System Log > New Log Recorder and use jenkins.plugins.openstack.compute as the logger name.

Access openstack client from groovy console

Use Jenkins.instance.clouds[0].openstack.@clientProvider.get() to access the openstack4j client. Users are discouraged to use this anything else but querying the openstack (otherwise there is no way to ensure plugin will work correctly). For older versions fo the plugin use Jenkins.instance.clouds[0].openstack.@client.

User Data / Cloud init is not evaluated

The image might not support it at all or can fail executing it. Check machine log in OpenStack for further details. Note that for now, there is no guarantee the script will complete before machine is connected to Jenkins and builds are started.


Version 2.32
Version 2.31
Version 2.30
Version 2.29 (2017-10-20)
Version 2.27 (2017-10-03)
Version 2.26

Botched release - changes went to 2.27

Version 2.25 (2017-09-25)
Version 2.24 (2017-08-17)

Note this version is affected by httpclient connection leak - use 2.27 instead.

  • Pipeline step for agentless node provisioning

  • Prefer IPv4 address for SSH launcher
  • Prevent occasional IllegalArgumentException: Failed to instantiate class jenkins.plugins.openstack.compute.SlaveOptions while saving global configuration page
  • First attempt to implement Openstack client caching between requests
  • This version is affected by occasional httpclient connection blockage
Version 2.23
Version 2.22
  • Investigate SSH channel is closed/No route to host (Issue #149)
Version 2.21
Version 2.20

No user visible changes included

Version 2.19
Version 2.18
Version 2.17
  • Restore config-file-provider <2.13 support properly JENKINS-41024 - Getting issue details... STATUS
Version 2.16
  • Restore config-file-provider <2.13 support - Do not use this version!
Version 2.15 (2017-01-02)
  • Do not wait for successful launch while provisioning.
    • There should be less failed launch attempts right after the node is provisioned.
      • The time statistics are not comparable to the older ones (provisioning time is longer, launching is shorter).
Version 2.14 (2016-11-21)
  • Bugfix; do not fail when region is empty.
Version 2.13 (2016-10-22)
  • Bugfix: avoid classloading issue caused by pom refactoring.
Version 2.8 (2016-06-06)
  • Fix floating IP deallocation when machine is deleted (Issue #81)
Version 2.7 (2016-05-16)
  • Do not leak servers when floating ip assignment fails.
  • Avoid deadlock caused by adding and deleting OpenStack nodes.
  • Avoid phony failures in destroyServer cause by server disappearing when retrying deletion.
Version 2.6 (2016-05-10)
Version 2.5 (2016-05-05)
  • Make sure plugin can reach all important endpoints when testing connection (JENKINS-34578)
Version 2.4 (2016-05-04)
  • Plugin fails to resolve image ID on some OpenStack deployments (JENKINS-34495)
Version 2.3 (2016-04-21)
  • Never remove slave put temporarily offline by user
  • Plugin can now handle images with blank name
  • Fix server deletion retry logic
  • Make key-pair field selectable on global config page
Version 2.2 (2016-04-11)
  • OpenStack slaves can be put into "pending delete" state pressing "Delete" button while build is in progress.
  • Instances out of disk space in /tmp or workspace will be put into "pending delete" state and removed eventually.
  • Maximal number of instances limitation implemented for templates.
  • Maximal number of instances can be set to more than 10 (regression from 2.1).
Version 2.1 (2016-03-31)
  • Machine/slave options can be specified on both cloud level as well as template level (Maximal number of instances limitation is implemented on 2.2).
  • Images/snapshots are identified by name, not image id.
  • Add support for floating pool name selection.
Version 2.0 (2016-02-22)
  • Jobs without label are never scheduled, so does most of matrix combinations(JENKINS-29998)
  • Drop support for blobstore. (This is not a rejection of the feature. None of the maintainers have an environment to reproduce this. Please reach us if you care for this feature and have an option to run the tests)
  • Drop support for injecting private key from plugin. Should be done by configuration management.
  • Replace JClouds backend with openstack4j.
  • Move to singlemodule maven project avoiding dependency shading.
Version 1.5 (released February 2015)
Version 1.4 (released February 2015)
  • InitScript is moved out. use cloud-init plus userData instead
  • Fix bug with multiple zones, now plugin restricts user to only one single zone
  • get rid of SpoolingBeforeInstanceCreation as it is paid-cloud parameter only
Version 1.3 (released January, 2015)
  • Initial release


  1. it keeps showing "401 not authorized" for me.

    it would be great to have more documentation around "credential" and "identity" fields -

    should I use the project name or my login name in "identity" field? do I need to include this "tenant:" prefix as on the sample screenshot?

    what privileges do I need to have set up to use this plugin? I can create and destroy VMs through Openstack web UI. I assume that is enough (?).

    when I request a new token from Openstack, I get a large JSON response with several "ids". which value do I need to put into "credential" field?

    UPDATE: I see my domain login and password are accepted - although I expected the plugin to take the "secret token" rather than a password... I think this should be documented on the plugin page (here)...

  2. Unknown User (david.antliff)

    According to a merged pull request last year, this plugin supports assignment of floating IP addresses to new instances. However this is not working for me in Jenkins 1.650, plugin version 2.0. New instances are successfully spawned, and floating IP addresses are available in the pool, but none are assigned to the new instance, and I can't see a way to configure this other than the feature enable tick-box. Before I file a bug, I'd like to check that I haven't missed anything I need to configure in Jenkins, the plugin, or OpenStack itself.

    1. This has probably nothing to do with the version of Jenkins rather with openstack configuration. Before version 2.1, the plugin allocated the IP in default pool which openstack might not have configured. In 2.1, proper support for floating ip pool selection was instroduced.

  3. I am using the plugin , i see that all the values shown except image-ids , what is missing in the configuration or any log i can check .

    Can anyone help me in it

    1. Is the select empty or the options there are blank? Anything related in logs? Have you enabled detailed logging?

  4. Dear Maintainer(s),

    Could you please add a configuration item to the slave template of "mode"? Currently it is hard coded as "hudson.model.Node.Mode.NORMAL", but in many cases, it needs to be "hudson.model.Node.Mode.EXCLUSIVE". Could you please add it?



  5. Hi,

    I'm using this plugin, one limitation in my user scenario, I want to add more than one network when creating instance. I try to use "nova interface-attach" to attach another network in userdata, but it failed, seems openstack(2.X) does not support yet, it raised error "HTTPNotImplemented".

    For this plugin, any plan to support adding multi networks in one template?

  6. When I install the plugin, the dropdown for providers only contains ec2. I cannot change it. I'm using jenkins 2.110 and plugin version 2.14

    1. Please disregard my comment above, it was intended for another plugin.

Write a comment…