-
Bug
-
Resolution: Fixed
-
Major
-
AWS Hosted CentOS release 6.4 (Final) x86_64
Jenkins ver. 1.533
Amazon EC2 plugin 1.18
This issue has come up in the past ~48 hours or so after a dev added a theme plugin and updated plugins.
Ec2 plugin now states that instance cap has been reached and will not provision any further instances.
Currently no slave instances exist (all terminated several hours ago).
Plugin has been disabled and re-enabled.
Cloud config removed and re-created.
Cap has been increased to 50 (normally 10)
All without success.
Log output as below
02/10/2013 9:48:03 PM hudson.plugins.ec2.EC2Cloud addProvisionedSlave
INFO: Total instance cap of 10 reached, not provisioning.
02/10/2013 9:48:13 PM hudson.plugins.ec2.EC2Cloud addProvisionedSlave
INFO: Total instance cap of 50 reached, not provisioning.
I've observed the same issue in 1.19 of the plugin. Looking at the code (specifically, EC2Cloud.addProvisionedSlave() and EC2Cloud.countCurrentEC2Slaves()), it appears the plugin counts all instances in the EC2 account, not just the ones launched by Jenkins. In other words, if you have other instances in your EC2 account, they count, as well.
To work around the bug, I did the following:
With those changes, only instances of the same AMI count against the cap. This is still a bug, though, since it is quite possible for the same AMI to be used for other things (in our case, we have an old Hudson cluster that happens to use the same AMI).
In order to make this more dependable, I'd recommend using tags to remember which instances were launched by this particular Jenkins master. Maybe one tag (JenkinsCluster) that's the URL of the master, and a second tag (JenkinsCloud) that's the name of the cloud configuration. The tags would then be used to find the instances again.