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

EC2 fails to provision due incorrect instance cap


      We have been having issues with the EC2 plugin versions above 1.39 where jenkins wont connect to nodes once stopped.
      Our nodes are all set at instance caps of 1 however, when jenkins tries to bring back up a node it successfully launches it but fails to provision as it thinks we have an instance cap of 0 Cannot provision - no capacity for instances: 0
      Changing our instance cap to 2 instances allows jenkins to connect to one of the nodes but when it tries to re-startup a second node we then see `Cannot provision - no capacity for instances: 0` It seems like the instance cap is off by one.


      SlaveTemplate{ami='ami-0095fb81fe067be99', labels='devops'}. Attempting to provision slave needed by excess workload of 1 units
       Oct 04, 2019 3:17:02 PM INFO hudson.plugins.ec2.EC2Cloud getNewOrExistingAvailableSlave
       SlaveTemplate{ami='ami-0095fb81fe067be99', labels='devops'}. Cannot provision - no capacity for instances: 0



      We are running jenkins 2.190.1 with Amazon EC2 plugin version 1.46.1 on an EC2 instance running ubuntu 18.04

            thoulen FABRIZIO MANFREDI
            ryan_m ryan M
            0 Vote for this issue
            4 Start watching this issue