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

Vsphere plugin and dynamic slaves

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello all,

      After doing a lot of research I had to come here and do my question "in person" cause I couldnt find my answer.

      what I am trying to do: Configure vsphere cloud and start a dynamic slave using the template configured on the vsphere cloud plugin.

      What is going on so far?
      I have a job which only has the following:
      node('nodeLabel')
      {
      bat 'dir'
      }

      "nodeLabel" is the name I gave on the template configuration of the vsphere cloud. Once I start the job, I can see that a new machine is created (cloned from my template) and it is started and then nothing happens anymore. The job cannot login to the machine cause it doesnt now the user name and password to it and also, even if I login myself, jenkins cannot start the node as a slave.

      On the wiki of the page there is an image where it shows that you can give an user name and password to the template, but with the newer version this is not existing anymore.

      How can I make this to work? Is this a known issue or am I missing something?

      There are three pictures attached:
      CloudConfiguration.jpg: How I configured my vsphere cloud
      SlaveStartupError.jpg: the error that happens when the slave is trying to be created.
      NodeConfiguration.jpg: The dynamic node that the plugin created (strange thing here is that there is no execution line for the slave and also no "secret" code)

      Thank you all in advance,
      Rafael

        Attachments

          Activity

          Hide
          jdoose Jens Doose added a comment -

          you selected the jenkins client startup method "Launch agent via Java Web Start". In that case (if I understood it correctly) you have to take care by yourself, that the Jenkins Client will be started after machine bootup.

          To do so you have to forward information like Jenkins Master URL and Node Token to the client via "guestinfo". Using VMWare Tools on the client you can read the given guestinfo information and use it to start the Jenkins Client.

          Have you done this? If no, then this is the problem. The master waits until client is ready, but the client never connects to the master.

           

          If you are using Linux clients you can (and should) use the SSH start method. The documentation states incorrectly that it would be the default.

          If you are using Windows the Java Web Start would probably the only way to start the Jenkins Client.

          Show
          jdoose Jens Doose added a comment - you selected the jenkins client startup method "Launch agent via Java Web Start". In that case (if I understood it correctly) you have to take care by yourself, that the Jenkins Client will be started after machine bootup. To do so you have to forward information like Jenkins Master URL and Node Token to the client via "guestinfo". Using VMWare Tools on the client you can read the given guestinfo information and use it to start the Jenkins Client. Have you done this? If no, then this is the problem. The master waits until client is ready, but the client never connects to the master.   If you are using Linux clients you can (and should) use the SSH start method. The documentation states incorrectly that it would be the default. If you are using Windows the Java Web Start would probably the only way to start the Jenkins Client.
          Hide
          lil2006 Igor Tereshchuk added a comment -

          for me interested these steps how it should performed 

          To do so you have to forward information like Jenkins Master URL and Node Token to the client via "guestinfo". Using VMWare Tools on the client you can read the given guestinfo information and use it to start the Jenkins Client.

          Have you done this? If no, then this is the problem. The master waits until client is ready, but the client never connects to the master.

          In docs not obvious what steps should be done. Please elaborate.
          Thanks

          Show
          lil2006 Igor Tereshchuk added a comment - for me interested these steps how it should performed  To do so you have to forward information like Jenkins Master URL and Node Token to the client via "guestinfo". Using VMWare Tools on the client you can read the given guestinfo information and use it to start the Jenkins Client. Have you done this? If no, then this is the problem. The master waits until client is ready, but the client never connects to the master. In docs not obvious what steps should be done. Please elaborate. Thanks
          Hide
          jdoose Jens Doose added a comment -
          Show
          jdoose Jens Doose added a comment - Check out the documentation: https://wiki.jenkins.io/display/JENKINS/vSphere+Cloud+Plugin
          Hide
          pjdarton pjdarton added a comment -

          FYI I've updated the wiki page with a bit of additional explanatory text.  Hopefully that should give enough detail to get things working.

          In any case, this is not a bug.

          Show
          pjdarton pjdarton added a comment - FYI I've updated the wiki page with a bit of additional explanatory text.  Hopefully that should give enough detail to get things working. In any case, this is not a bug.
          Hide
          kanage Kanageswari K added a comment - - edited

          We have a pipeline that requires multiple VMs eg: master and worker nodes that execute script on all of them. 

          When I use nested statements of

          def MASTER_NODE= “”

          def WORKER_NODE=””

          node('node-label) {    // master

          MASTER_NODE = sh(script: 'hostname -f', returnStdout: true).trim()

          node('node- label) 

          {   // worker    WORKER_NODE = sh(script: 'hostname -f', returnStdout: true).trim()   …… .... }

          }

          plugin creates VMs and made it as slave nodes but the scope in the jenkins file remains to the inner most VM  which is worker in my case. I have to switch the context between master and slave VMs multiple times and run scripts.   Is there a way to achieve this usecase?

          Show
          kanage Kanageswari K added a comment - - edited We have a pipeline that requires multiple VMs eg: master and worker nodes that execute script on all of them.  When I use nested statements of def MASTER_NODE= “” def WORKER_NODE=”” node('node-label) {    // master MASTER_NODE = sh(script: 'hostname -f', returnStdout: true).trim() node('node- label)  {   // worker    WORKER_NODE = sh(script: 'hostname -f', returnStdout: true).trim()   …… .... } } plugin creates VMs and made it as slave nodes but the scope in the jenkins file remains to the inner most VM   which is worker in my case. I have to switch the context between master and slave VMs multiple times and run scripts.   Is there a way to achieve this usecase?
          Hide
          pjdarton pjdarton added a comment -

          I have no idea if your usecase is possible - I'd guess it is as most things are possible (especially using a pipeline), but I don't know how, and this isn't the place for general support questions.
          I'd suggest you ask in the Jenkins forums about how to alternate between master & slave contexts - your usecase is unlikely to be specific to the vSphere plugin.

          Show
          pjdarton pjdarton added a comment - I have no idea if your usecase is possible - I'd guess it is as most things are possible (especially using a pipeline), but I don't know how, and this isn't the place for general support questions. I'd suggest you ask in the Jenkins forums about how to alternate between master & slave contexts - your usecase is unlikely to be specific to the vSphere plugin.
          Hide
          kanage Kanageswari K added a comment - - edited

          Thanks for your response. Sorry if my question is not very obvious. It is already a working pipeline in which we have implemented this specific usecase with both static slaves and pooled nodes. The question here is about how to use the vsphere cloud plugin to create and use multiple VMs in the pipeline.  using node('node-label) {  the scope is limited to that particular slave node.

          Show
          kanage Kanageswari K added a comment - - edited Thanks for your response. Sorry if my question is not very obvious. It is already a working pipeline in which we have implemented this specific usecase with both static slaves and pooled nodes. The question here is about how to use the vsphere cloud plugin to create and use multiple VMs in the pipeline .  using node('node-label) {  the scope is limited to that particular slave node.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            rpwerner Rafael Werner
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: