-
Bug
-
Resolution: Unresolved
-
Major
-
None
The EC2 plugin lets you specify an instance cap for a Cloud (and also an instance cap for each individual AMI).
There is a bug in the cloud instance cap handling when you have multiple clouds defined.
If I have an instance cap for Cloud X, and a job needs (via label) to launch an Agent in that Cloud, the EC2 plugin checks that we have not reached the cloud instance cap. If the cap has been reached, it won't launch a new Agent. Instead, it reports
Cannot provision - no capacity for instances: 0
The calculation is buggy. It counts the number of currently running Agents across all defined clouds, and then compares that with the instance cap for the specific cloud in question. When counting the number of active Agents to compare against the Cloud instance cap, it should only count active Agents in the cloud in question.
This bug seems related to https://github.com/jenkinsci/ec2-plugin/pull/650.