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

invalid login for second template in one vsphere cloud

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • vsphere-cloud-plugin
    • Jenkins 2.19.1
      Vsphere Plugin 2.14
      Vsphere Server 5.5
      Windows Server 2008 R2

      if i create a Vsphere Cloud and one template => check template is working fine. If i then duplicate the template entry and try "check template" on the second, i get the following error message

      Problem validating org.jenkinsci.plugins.vsphere.tools.VSphereException: com.vmware.vim25.InvalidLogin: The logon can not be completed due to an incorrect user name or password

      If i create another Vsphere Cloud and one template their, it is also working, only the second template is not working.

          [JENKINS-40336] invalid login for second template in one vsphere cloud

          Jan Bottek created issue -
          Michel Lawaty made changes -
          Attachment New: ErrorSTackTrace_SecondvSPhereTemplate.txt [ 35237 ]
          Attachment New: Screen Shot 2016-12-21 at 09.40.54.png [ 35238 ]

          Michel Lawaty added a comment - - edited

          I can confirm this error.
          Precondition:

          • Jenkins is connected to a vCenter instance
          • Two templates (or VMs) available on the vCenter instance

          Steps:

          • Add a vSphere cloud
          • Verify the connection by clicking "Test Connection" --> "Success"
          • Register first VM by adding Template A name, and verify by "Check Template" --> "Success"
          • Register a second Template A (or Template B) by adding anoter "Add vSphere Template"
          • Verify by "Check Template"
            • --> Leads to error attached in text file: "Problem validating org.jenkinsci.plugins.vsphere.tools.VSphereException: com.vmware.vim25.InvalidLogin: Cannot complete login due to an incorrect user name or password."

          Expected:

          • Should lead to "Success"

          Attached:
          ErrorSTackTrace_SecondvSPhereTemplate.txt

          Michel Lawaty added a comment - - edited I can confirm this error. Precondition: Jenkins is connected to a vCenter instance Two templates (or VMs) available on the vCenter instance Steps: Add a vSphere cloud Verify the connection by clicking "Test Connection" --> "Success" Register first VM by adding Template A name, and verify by "Check Template" --> "Success" Register a second Template A (or Template B) by adding anoter "Add vSphere Template" Verify by "Check Template" --> Leads to error attached in text file: "Problem validating org.jenkinsci.plugins.vsphere.tools.VSphereException: com.vmware.vim25.InvalidLogin: Cannot complete login due to an incorrect user name or password." Expected: Should lead to "Success" Attached: ErrorSTackTrace_SecondvSPhereTemplate.txt
          Michel Lawaty made changes -
          Attachment New: Screen Shot 2016-12-22 at 14.38.23.png [ 35259 ]

          Michel Lawaty added a comment -

          We found a workaround, and probably the cause of the bug:

          You have to go the template settings of your last added template (one above the one you see the validation exception), and change the "Launch Method" to "...via SSH". Then a credential window appears. Make sure to change to the credentials, which actually have access to your vcenter instance (in the screenshot: "jenkins_control").
          Then press "Check Template" and it should work.

          Michel Lawaty added a comment - We found a workaround, and probably the cause of the bug: You have to go the template settings of your last added template (one above the one you see the validation exception), and change the "Launch Method" to "...via SSH". Then a credential window appears. Make sure to change to the credentials, which actually have access to your vcenter instance (in the screenshot: "jenkins_control"). Then press "Check Template" and it should work.

          Jan Bottek added a comment -

          Hi Michael,

          the workaround you provided didn't worked for me. I changed the Launch Method the SSH and select the credentials which i already select for the Vsphere host, instead the one i have to use really for SSH connection. But i get the same error before.

          Jan Bottek added a comment - Hi Michael, the workaround you provided didn't worked for me. I changed the Launch Method the SSH and select the credentials which i already select for the Vsphere host, instead the one i have to use really for SSH connection. But i get the same error before.

          Michel Lawaty added a comment -

          Hi Jan,
          did you press apply after changing to the vsphere user? Maybe the change was not persisted.
          After checking the template connection successfully you can change back to JNLP or whatever you had as a setting, and go on.

          Michel Lawaty added a comment - Hi Jan, did you press apply after changing to the vsphere user? Maybe the change was not persisted. After checking the template connection successfully you can change back to JNLP or whatever you had as a setting, and go on.

          Jan Bottek added a comment -

          Hi,

          yes saved the settings, but same results. Currently i worked around this bug with a second Cloud Instance.

          Jan Bottek added a comment - Hi, yes saved the settings, but same results. Currently i worked around this bug with a second Cloud Instance.

          Jan Bottek added a comment -

          I now deleted also my second Cloud Instance and configured a second template to my first Cloud instance, but same result, i cannot get the workaround working. Any idea what is different between our two setups?

          Jan Bottek added a comment - I now deleted also my second Cloud Instance and configured a second template to my first Cloud instance, but same result, i cannot get the workaround working. Any idea what is different between our two setups?

          Michel Lawaty added a comment -

          Are you sure you set the first section in the config dialog also right?

          ------
          General config
          vSphere Cloud
          Name of this Cloud Help for feature: Name of this Cloud
          vSphere Host Help for feature: vSphere Host
          Credentials: user which can control vsphere


          Template 1
          set the agent credetnail temporarly to vpshere user (as described )

          Template 2

          Are your vsphere user credentials really working? e.g. Template 1 check is successful?

          Michel Lawaty added a comment - Are you sure you set the first section in the config dialog also right? ------ General config vSphere Cloud Name of this Cloud Help for feature: Name of this Cloud vSphere Host Help for feature: vSphere Host Credentials: user which can control vsphere Template 1 set the agent credetnail temporarly to vpshere user (as described ) — Template 2 Are your vsphere user credentials really working? e.g. Template 1 check is successful?

            Unassigned Unassigned
            wreggyl Jan Bottek
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: