If enabled, Jenkins supports provisioning of JNLP-based agents on virtual machines. There are two mechanisms provided:
  1. As soon as the name of a virtual machine is known after it's allocation, the metadata of that machine gets augmented with 3 properties:
    • X-jar provides the URL of the agent.jar.
    • X-url provides the JNLP-URL for the virtual machine.
    • X-sec provides the necessary secret for contacting jenkins
    These properties then can be used by the virtual machine, to automate startup of a JNLP client. Of course, these properties can be seen by anyone who has administative access to your cloud environment. You must decide for yourself if this poses a security risk.

    This feature is currently implemented for openstack-nova and google-compute-engine only.

  2. For cloud providers that do not support custom metadata, a nonce string is generated which can be inserted into userData or a startup script by placing ${JNLP_NONCE} in the associated content. Using that nonce, the virtual machine can issue a POST request to
    http://your.jenkins.url/jclouds-jnlp-provision/
     using auth=auth and hostname=hostname
                and retrieve the above 3 properties as a JSON response. The value of auth must be a base64-encoded
                SHA256 hash of the concatenation of the nonce and the node name (hostname).

    This feature works with all providers that support supplying userData at instance creation.