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

EC2 plugin incorrectly reports current instance count

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • 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.

          [JENKINS-19845] EC2 plugin incorrectly reports current instance count

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          http://jenkins-ci.org/commit/ec2-plugin/dd2d1e63d423e0cfb4ee0a9ca38bfdc2c0c223eb
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Improvement, not a fix. This code checks if the tags match the configured tags

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java http://jenkins-ci.org/commit/ec2-plugin/dd2d1e63d423e0cfb4ee0a9ca38bfdc2c0c223eb Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Improvement, not a fix. This code checks if the tags match the configured tags

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://jenkins-ci.org/commit/ec2-plugin/e81094cc897ddeb456d20bc8c3cc03fafbfa970c
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Now using the specific 'ec2slave' tag

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://jenkins-ci.org/commit/ec2-plugin/e81094cc897ddeb456d20bc8c3cc03fafbfa970c Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Now using the specific 'ec2slave' tag

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          http://jenkins-ci.org/commit/ec2-plugin/ace707c4a3498384d8d6c382a84200152f17cb1e
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Now using the specific 'ec2slave' tag

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java http://jenkins-ci.org/commit/ec2-plugin/ace707c4a3498384d8d6c382a84200152f17cb1e Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Now using the specific 'ec2slave' tag

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          http://jenkins-ci.org/commit/ec2-plugin/f2a97d5204df32f177e18d5ac9e84324c876215d
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Now using the specific 'ec2slave' tag

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java http://jenkins-ci.org/commit/ec2-plugin/f2a97d5204df32f177e18d5ac9e84324c876215d Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Now using the specific 'ec2slave' tag

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          http://jenkins-ci.org/commit/ec2-plugin/58fbb7f3a492f4f04c7a32881e6c9946241524fb
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Now using the specific 'ec2slave' tag

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java http://jenkins-ci.org/commit/ec2-plugin/58fbb7f3a492f4f04c7a32881e6c9946241524fb Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Now using the specific 'ec2slave' tag

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://jenkins-ci.org/commit/ec2-plugin/deffa182c4d64fcaf187010814b86df40d61a6a2
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Now using the specific 'ec2slave' tag

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://jenkins-ci.org/commit/ec2-plugin/deffa182c4d64fcaf187010814b86df40d61a6a2 Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Now using the specific 'ec2slave' tag

          Code changed in jenkins
          User: Roland Groen
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/EC2Tag.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://jenkins-ci.org/commit/ec2-plugin/5286a643db63d6199f1a99e2015046e0948c7867
          Log:
          JENKINS-19845, EC2 plugin incorrectly reports current instance count

          • Changed tag name to jenkins_slave_type
          • Made the tag name a static value
          • Cleaned up indentation
          • Removed eclipse import format changes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Roland Groen Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/EC2Tag.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://jenkins-ci.org/commit/ec2-plugin/5286a643db63d6199f1a99e2015046e0948c7867 Log: JENKINS-19845 , EC2 plugin incorrectly reports current instance count Changed tag name to jenkins_slave_type Made the tag name a static value Cleaned up indentation Removed eclipse import format changes

          Code changed in jenkins
          User: Francis Upton
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/EC2Tag.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://jenkins-ci.org/commit/ec2-plugin/2b28c7acb1d45e558c0ad8b306c960ed91d8a43d
          Log:
          Merge pull request #107 from EdiaEducationTechnology/master

          JENKINS-19845

          Compare: https://github.com/jenkinsci/ec2-plugin/compare/b99f8191e990...2b28c7acb1d4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francis Upton Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/EC2Tag.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://jenkins-ci.org/commit/ec2-plugin/2b28c7acb1d45e558c0ad8b306c960ed91d8a43d Log: Merge pull request #107 from EdiaEducationTechnology/master JENKINS-19845 Compare: https://github.com/jenkinsci/ec2-plugin/compare/b99f8191e990...2b28c7acb1d4

          martinfr62 added a comment -

          This fix does not resolve the following use cases

          1. Multiple jenkins servers running in the same VPC using the same ami - needed when 1 jenkins cannot manage that many jobs and/or each team wants their own jenkins server

          2. Multple labels using same ami
          2.1 - Different instance sizes for different build jobs/labels (eg use 5 T2Medium and 4 Large of same ami)
          2.2 - Different subnets used for different labels - all sorts of reasons to use multiple subnets (access control just being one of them)
          2.3 - Different instance counts for different labels/builds - so can manage costs differently (eg 2 for nightly builds and 5 for release and 10 for CI) - this allows bunch of CI builds to not block a release build for instance, or for the long running nightly build to not interfere with a CI build.

          Proposed solution - extend current fix of a tag to indicate this is a jenkins instance, to indicate it's a jenkins instance for a specific label - add labels to the EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE when instance started and match the label requested in isEc2ProvisionedSlave

          Solves both 1 and 2.

          martinfr62 added a comment - This fix does not resolve the following use cases 1. Multiple jenkins servers running in the same VPC using the same ami - needed when 1 jenkins cannot manage that many jobs and/or each team wants their own jenkins server 2. Multple labels using same ami 2.1 - Different instance sizes for different build jobs/labels (eg use 5 T2Medium and 4 Large of same ami) 2.2 - Different subnets used for different labels - all sorts of reasons to use multiple subnets (access control just being one of them) 2.3 - Different instance counts for different labels/builds - so can manage costs differently (eg 2 for nightly builds and 5 for release and 10 for CI) - this allows bunch of CI builds to not block a release build for instance, or for the long running nightly build to not interfere with a CI build. Proposed solution - extend current fix of a tag to indicate this is a jenkins instance, to indicate it's a jenkins instance for a specific label - add labels to the EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE when instance started and match the label requested in isEc2ProvisionedSlave Solves both 1 and 2.

          Francis Upton added a comment -

          The tag has been extended with the description of the slave template. This should resolve the problems. This was done prior to 1.30.

          Francis Upton added a comment - The tag has been extended with the description of the slave template. This should resolve the problems. This was done prior to 1.30.

            francisu Francis Upton
            simonbeckett Simon Beckett
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: