Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitchen failure when adding spot_price #328

Closed
Evesy opened this issue Jul 14, 2017 · 4 comments
Closed

Kitchen failure when adding spot_price #328

Evesy opened this issue Jul 14, 2017 · 4 comments
Labels

Comments

@Evesy
Copy link

Evesy commented Jul 14, 2017

Hi,

When trying to specify a spot price in my .kitchen.yml I receive the below error upon running any kitchen converge/test/verify commands:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [unexpected value at params[:launch_specification][:placement][:tenancy]]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Some environment info:

Test Kitchen version 1.4.2
kitchen-cloudstack (0.22.0)
kitchen-ec2 (1.3.2)

My .kitchen.yml is as below -- If I comment out the spot_price parameter kitchen runs successfully.

---
driver:
  name: ec2
  aws_ssh_key_id: kitchen
  subnet_filter:
    tag: 'Name'
    value: 'subnet-private-b'
  security_group_ids: ["<sg-id>", "<sg-id>"]
  region: eu-west-1
  instance_type: t2.micro
  spot_price: 0.010

transport:
  ssh_key: ~/.ssh/kitchen

platforms:
  - name: centos-7
    driver:
      image_id: "<ami-id>"

suites:
  - name: default
    provisioner:
      name: chef_solo
      require_chef_omnibus: <%= ENV['REQUIRE_CHEF_OMNIBUS'] %>
      data_bags_path: <%= ENV['DATA_BAGS_PATH'] %>
      data_path: test/shared
    run_list:
      - recipe[filebeat::default]
    attributes: {}

Any help would be appreciated

Cheers!

@Evesy
Copy link
Author

Evesy commented Jul 14, 2017

I have also tried with an m3.medium instance as I don't actually think t2.micro's are available as spot instances, however the results are the same.

@Evesy
Copy link
Author

Evesy commented Jul 17, 2017

This occurs when setting default & dedicated as tenancy type.

When setting 'host' as the tenancy type (Which is unsupported as per http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Types/SpotPlacement.html), Kitchen successfully launches a spot instance with default tenancy type.

@cheeseplus cheeseplus added the Bug label Jan 22, 2018
@irvingpop
Copy link

this appears to have been fixed along the way and seems to work quite nicely ( tested on ChefDK 2.5.3):

---
driver:
  name: ec2
  region: <%= ENV['AWS_REGION'] || 'us-east-1' %>
  instance_type: m5.large
  spot_price: 0.0960
  associate_public_ip: true
  interface: public
  ebs_optimized: true
  block_device_mappings:
  - device_name: /dev/sda1
    ebs:
      volume_type: gp2
      volume_size: 50
      delete_on_termination: true

@Evesy
Copy link
Author

Evesy commented May 16, 2018

Thanks @irvingpop !

I'm not able to verify myself but I'll close this off based on your findings

@Evesy Evesy closed this as completed May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants