Make vSphere plugin work

27 views
Skip to first unread message

Christoph Fetzer

unread,
Apr 1, 2020, 11:13:45 AM4/1/20
to Jenkins Users
Hi,

I have access to an Esxi-Server used by a vSphere instance. I set up a vsphere cloud in my Jenkins installation properly ("Test connection" works).
I set up a template VM (Windows 10) with a Snapshot, Autologon and Autostart according to https://github.com/jenkinsci/vsphere-cloud-plugin/blob/master/docs/vm-configuration.md
I configured a startup template in the vSphere cloud according to: https://github.com/jenkinsci/vsphere-cloud-plugin/blob/master/docs/jenkins-configuration.md
I'd like to use the approch "Static configuration" mentioned for startup of the nodes.
In the vSphere cloud I made the plugin use "VC9-build" als label for the nodes.
Then I changed a build job based on that Jenkinsfile (declarative):

#!groovy
pipeline
{
    agent
{
        label
'VC9-build'
   
}
...
}


My expectation is that after start of the job the vsphere plugin would clone a VM in ESXI, start that up, connect it to jenkins and make the job run there.
Instead I only have a job in may waiting queue with the name "part of ${jobname}" and I can't see anything on vSpere so I guess clone of the machine didn't even start.
Am I missing a link somewhere in to make the node creation start?

BR,
Christoph

Gianluca

unread,
Apr 1, 2020, 11:38:11 AM4/1/20
to Jenkins Users
Hi,
we use vSphere cloud plugin and some hints to help you debug:
1) go to the Jenkins log and check any error there
Some errors we had in the past:
- typo in the node label and the clone never started
- clone started but it was failing due to permission errors in vSphere (the user is not able to do the action, test connection only check that you can connect ... not all permission needed)

2) go to the vCenter and check that the VM is actually created; we had issues with the VM not being powered on or wrong networking into the template

3) go to the "Nodes" on Jenkins and check that the node appears there

4) go to the Node page and check any logs for any error

Christoph Fetzer

unread,
Apr 1, 2020, 3:40:02 PM4/1/20
to Jenkins Users
Hi Gianluca,

OK, the log was a good idea, thank you very much!
There I found:
Started provisioning VC9BuildSlave97yt3vpya79krvglcpcgevei4 from vSphereCloud with 1 executors. Remaining excess workload: 0
Apr 01, 2020 5:13:01 PM WARNING org.jenkinsci.plugins.vSphereCloud$VSpherePlannedNode$1 call
Failed to provision new slave VC9BuildSlave97yt3vpya79krvglcpcgevei4
org
.jenkinsci.plugins.vsphere.tools.VSphereNotFoundException: vSphere Error: Datastore "XXX_RAID5_Datastore" not found
        at org
.jenkinsci.plugins.vsphere.tools.VSphere.createRelocateSpec(VSphere.java:336)
        at org
.jenkinsci.plugins.vsphere.tools.VSphere.cloneOrDeployVm(VSphere.java:235)
        at org
.jenkinsci.plugins.vSphereCloudSlaveTemplate.provision(vSphereCloudSlaveTemplate.java:428)
        at org
.jenkinsci.plugins.vSphereCloudSlaveTemplate.provision(vSphereCloudSlaveTemplate.java:403)
        at org
.jenkinsci.plugins.vSphereCloud$VSpherePlannedNode.provisionNewNode(vSphereCloud.java:534)
        at org
.jenkinsci.plugins.vSphereCloud$VSpherePlannedNode.access$100(vSphereCloud.java:496)
        at org
.jenkinsci.plugins.vSphereCloud$VSpherePlannedNode$1.call(vSphereCloud.java:510)
        at org
.jenkinsci.plugins.vSphereCloud$VSpherePlannedNode$1.call(vSphereCloud.java:506)
        at jenkins
.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        at jenkins
.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
        at java
.util.concurrent.FutureTask.run(Unknown Source)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java
.lang.Thread.run(Unknown Source)

Unfortunately this exactly matches the name of the datastore as displayed in vSphere (copy'n'pasted - replace the triple X with the actual hostname).
Capture.PNG










Sorry for the german UI. Did I get something wrong? Isn't this the proper ID for the datastore?
The user is administrator on the whole server (I know but that's the next step).

BR,
Christoph

Gianluca

unread,
Apr 1, 2020, 3:45:31 PM4/1/20
to Jenkins Users
We had these issue in the past ... and this is what we discovered:
1) VSphereNotFoundException is raised also in the case the user don't have permission to see it.
So, considering you are 100% sure the name is correct, I can tell you that it's a permission error.

2) I know it may seems strange ... I'm still scratching my head ... but even if a user is an administrator on vCenter, it may not have enough permissions on an ESXi datastore.
How this happens ... we never figure it out ... but the guy who is managing vCenter in our case, he was setting explicit permission on the single entity directly on the EXSi host and vCenter to workaround this issue.
I don't have more details than that about this permission issues, sorry

Cheers,
Gianluca.

Christoph Fetzer

unread,
Apr 6, 2020, 9:09:19 AM4/6/20
to Jenkins Users
JFTR:

By using my personal user credentials everything started to work. So it really seems to be a issue of my build user's access rights.
Thank you very much for the heads up!

Now I am trying to find out, why the start script is expecting the java installation beyond the SLAVE_HOME instead of the system JAVA_HOME but I guess I will make that by myself...
Reply all
Reply to author
Forward
0 new messages