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

[ec2-plugin] spot instance feature cannot be used within VPC

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The problem:

      Unable to launch a spot instance when using a VPC. Has anyone else had any success with this? I've seen reports of it working fine for users launching spot instances outside a VPC.

      Replicating and error message:

      When clicking 'provision via EC2' at jenkins:8080/computer I receive the following error

      Status Code: 400, AWS Service: AmazonEC2, AWS Request ID: 6079cf60-3c23-4ea7-935a-807bd5f81b95, AWS Error Code: InvalidParameterCombination, AWS Error Message: The parameter groupName cannot be used with the parameter subnet

      Investigation details:

      Launching an OnDemand instance within the same environment works fine. Also tried spinning up a spot instance using the AWS management console with the same details and was also able to spin one up.

      I've inspected the requestSpotInstanceRequest that gets sent to the AWS API and I can't see any mention of groupName. Below is the request I am sending.

      "InstanceCount => 1"
      "LaunchSpecification.SecurityGroup.1 => sg-ac5447c0"
      "LaunchSpecification.ImageId => ami-d97deee3"
      "Action => RequestSpotInstances"
      "LaunchSpecification.KeyName => sppbuild"
      "LaunchSpecification.UserData => SkVOS0lOU19V---moreuserdatawashere"
      "Type => persistent"
      "LaunchSpecification.SubnetId => subnet-dfad4fb6"
      "LaunchSpecification.InstanceType => c1.medium"
      "Version => 2012-12-01"
      "SpotPrice => 0.09"

      Any help with this issue would be greatly appreciated, if there is anymore information that would be of use I will be happy to provide it!

        Attachments

          Activity

          Hide
          mriddle Matthew Riddle added a comment -

          Identified the issue, it was the way we were setting the securityGroups on the launchSpecification.

          Have updated the plugin and created a pull-request here: https://github.com/jenkinsci/ec2-plugin/pull/63

          Show
          mriddle Matthew Riddle added a comment - Identified the issue, it was the way we were setting the securityGroups on the launchSpecification. Have updated the plugin and created a pull-request here: https://github.com/jenkinsci/ec2-plugin/pull/63
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Francis Upton
          Path:
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://jenkins-ci.org/commit/ec2-plugin/c33e297f2c3c748daffd97ca50f078caa74d3d62
          Log:
          Merge pull request #63 from mriddle/master

          JENKINS-19301 Fix: spot instance feature cannot be used within VPC

          Compare: https://github.com/jenkinsci/ec2-plugin/compare/8d5be49e298d...c33e297f2c3c

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francis Upton Path: src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://jenkins-ci.org/commit/ec2-plugin/c33e297f2c3c748daffd97ca50f078caa74d3d62 Log: Merge pull request #63 from mriddle/master JENKINS-19301 Fix: spot instance feature cannot be used within VPC Compare: https://github.com/jenkinsci/ec2-plugin/compare/8d5be49e298d...c33e297f2c3c
          Hide
          mriddle Matthew Riddle added a comment -

          Resolved by merge. #c33e297f2c

          Thanks!

          Show
          mriddle Matthew Riddle added a comment - Resolved by merge. #c33e297f2c Thanks!

            People

            • Assignee:
              francisu Francis Upton
              Reporter:
              mriddle Matthew Riddle
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: