-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins 2.14
vSphere Plugin 2.14
Even though the vSphere configuration for dynamic slaves has a field for setting a per slave instance cap, that cap is not honored and does not seem to actually be saved in the config.xml file.
In my slave definition, I set the slave instance cap to 2. But in the Jenkins log, I was finding this:
There are 0 number of VMs with the prefix UbuntuSlave-1. The instance cap for VMs with that prefix is: 2147483647
When I looked at the definition in the config.xml for the cloud, you can see that there is no per instance cap in the config.
My instance cap globally is 2 slaves that should be started. That is not honored either. It seems to limit the number of slaves actually used for builds, but then it seems to actually generate more slaves that that. I will attach the xml snippet from config, and a screenshot of what happened for the number of slaves generated.
XML Snippet of slave configuration. Note, the instance cap of 2 per slave is not in this configuration in the templates for the individual slave types:
<clouds>
<org.jenkinsci.plugins.vSphereCloud plugin="vsphere-cloud@2.13">
<name>vSphereCloud</name>
<vsDescription>Corp VC</vsDescription>
<maxOnlineSlaves>2</maxOnlineSlaves>
<vsConnectionConfig>
<vsHost>https://redacted.com</vsHost>
<credentialsId>df687fdb-ed89-4f9e-aa38-f3de8f40c79f</credentialsId>
</vsConnectionConfig>
<instanceCap>3</instanceCap>
<templates>
<org.jenkinsci.plugins.vSphereCloudSlaveTemplate>
<cloneNamePrefix>Windows10Slave-1</cloneNamePrefix>
<masterImageName>base-win10-1</masterImageName>
<snapshotName></snapshotName>
<linkedClone>true</linkedClone>
<cluster></cluster>
<resourcePool>BuildSlaves</resourcePool>
<datastore></datastore>
<templateDescription></templateDescription>
<numberOfExecutors>1</numberOfExecutors>
<remoteFS>/cygdrive/c/Users/Tanium</remoteFS>
<labelString>windows10</labelString>
<mode>EXCLUSIVE</mode>
<forceVMLaunch>true</forceVMLaunch>
<waitForVMTools>true</waitForVMTools>
<launchDelay>10</launchDelay>
<limitedRunCount>1</limitedRunCount>
<saveFailure>false</saveFailure>
<credentialsId>849621ed-4001-46ba-ad2c-b3b34248d2f9</credentialsId>
<nodeProperties/>
<POWER_ON>true</POWER_ON>
</org.jenkinsci.plugins.vSphereCloudSlaveTemplate>
<org.jenkinsci.plugins.vSphereCloudSlaveTemplate>
<cloneNamePrefix>UbuntuSlave-1</cloneNamePrefix>
<masterImageName>ubuntu-14.04-amd64</masterImageName>
<snapshotName></snapshotName>
<linkedClone>true</linkedClone>
<cluster></cluster>
<resourcePool>BuildSlaves</resourcePool>
<datastore></datastore>
<templateDescription></templateDescription>
<numberOfExecutors>1</numberOfExecutors>
<remoteFS>/home/vagrant</remoteFS>
<labelString>ubuntu1404</labelString>
<mode>EXCLUSIVE</mode>
<forceVMLaunch>true</forceVMLaunch>
<waitForVMTools>true</waitForVMTools>
<launchDelay>10</launchDelay>
<limitedRunCount>1</limitedRunCount>
<saveFailure>false</saveFailure>
<credentialsId>7e5ce264-01ce-4b73-915e-87cc7263ca4b</credentialsId>
<nodeProperties/>
<POWER_ON>true</POWER_ON>
</org.jenkinsci.plugins.vSphereCloudSlaveTemplate>
</templates>
</org.jenkinsci.plugins.vSphereCloud>
</clouds>