Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46375

vSphere template definition doesn't allow environment variables to be defined

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: vsphere-cloud-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.60.2
      vSphere Cloud plug-in 2.15
    • Similar Issues:

      Description

      Hi,

      We are considering using the vSphere Cloud plugin for our large scale Jenkins installation, but we are facing the following issue:

      • we need to set a couple of environment variables on the slaves being generated
      • no "Environment variable" section is available in the GUI for the "Node properties" of the template
      • we could manage to create the environment node properties programmatically and the corresponding created slaves have their environment correctly set
      • however, when we save the Jenkins global configuration, the environment node properties are gone again

       

      Is it possible to have the possibility to set the environment node properties, the same way the tool node properties can be set?

       

      Thanks,

      Damien Coraboeuf.

        Attachments

          Activity

          Hide
          pjdarton pjdarton added a comment -

          I do not believe that VMware/vSphere provides a means to do this.

          It is possible to pass in vSphere "GuestInfo" properties (the Jenkins vSphere plugin code can set these properties on the VM) but it would then be up to code running within the guest operating system to read those and set environment variables.

          Basically, vSphere doesn't give us the ability to set environment variables on the guest OS, but it does make it possible for code to run on the guest OS that sets environment variables.

          Show
          pjdarton pjdarton added a comment - I do not believe that VMware/vSphere provides a means to do this. It is possible to pass in vSphere "GuestInfo" properties (the Jenkins vSphere plugin code can set these properties on the VM) but it would then be up to code running within the guest operating system to read those and set environment variables. Basically, vSphere doesn't give us the ability to set environment variables on the guest OS, but it does make it possible for code to run on the guest OS that sets environment variables.
          Hide
          pjdarton pjdarton added a comment -

          It looks like there's a problem in the WebUI "jelly" code that binds the UI to the data that's preventing folks from doing this.
          While I don't see why the code doesn't work as-is (as it's doing the same stuff as works elsewhere), I think it's a fairly trivial fix (especially as the docker plugin has a working example we can use for inspiration).

          I've started work to fix this in PR#105. Those changes will likely go into the next release.

          Show
          pjdarton pjdarton added a comment - It looks like there's a problem in the WebUI "jelly" code that binds the UI to the data that's preventing folks from doing this. While I don't see why the code doesn't work as-is (as it's doing the same stuff as works elsewhere), I think it's a fairly trivial fix (especially as the docker plugin has a working example we can use for inspiration). I've started work to fix this in PR#105 . Those changes will likely go into the next release.
          Hide
          fbruzelius Fredrik Bruzelius added a comment -

          I think this is not limited to just the "Environment variables" node property. I am using the Workspace Cleanup Plugin and would like to set the "Disable deferred wipeout on this node" property, which is also missing.

          Show
          fbruzelius Fredrik Bruzelius added a comment - I think this is not limited to just the "Environment variables" node property. I am using the Workspace Cleanup Plugin and would like to set the "Disable deferred wipeout on this node" property, which is also missing.
          Hide
          pjdarton pjdarton added a comment -

          You'll be pleased to know that

          1. You are correct - this does affect the ws cleanup plugin node property, along with pretty much any other node property.
          2. I've fixed this issue in the as-yet-unreleased code, which I'm intending to release "soon" ... which will be "sooner" if you help ...
          3. ... you can get a pre-release build from here. Please try it out and let me know if it works for you - that'll help me and help speed up the official release.
          Show
          pjdarton pjdarton added a comment - You'll be pleased to know that You are correct - this does affect the ws cleanup plugin node property, along with pretty much any other node property. I've fixed this issue in the as-yet-unreleased code , which I'm intending to release "soon" ... which will be "sooner" if you help ... ... you can get a pre-release build from here . Please try it out and let me know if it works for you - that'll help me and help speed up the official release.
          Hide
          fbruzelius Fredrik Bruzelius added a comment - - edited

          Sorry for the late reply, I've been out of office for a few days.

          I deployed the pre-release to our staging environment, and successfully managed to set both the Ws Cleanup node property as well as environment variables and tool locations. So AFAICS the change works out well.

          Show
          fbruzelius Fredrik Bruzelius added a comment - - edited Sorry for the late reply, I've been out of office for a few days. I deployed the pre-release to our staging environment, and successfully managed to set both the Ws Cleanup node property as well as environment variables and tool locations. So AFAICS the change works out well.
          Hide
          pjdarton pjdarton added a comment -

          Fixed in plugin version 2.21, which was released a few minutes ago.

          Show
          pjdarton pjdarton added a comment - Fixed in plugin version 2.21, which was released a few minutes ago.

            People

            • Assignee:
              Unassigned
              Reporter:
              damien_coraboeuf Damien Coraboeuf
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: