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

image_id should be a bootstrap_options instead of machine_option? #46

Closed
miguelcnf opened this issue Dec 16, 2014 · 4 comments
Closed

Comments

@miguelcnf
Copy link
Contributor

As far as I can see, the image_id should be a bootstrap_option instead of a machine_option as described here.

This is also to be coherent with the fog:AWS driver.

@esciara
Copy link

esciara commented Dec 26, 2014

Even though the link you provide most likely refers to the fog:AWS driver only (does not look like there is a doc to this AWS driver at all), IMHO I would say that indeed, the image_id should be in bootstrap_options. I could not set my image_id at all (if you have a work around, I am all ears), and the driver defaulted automatically to an ebs type image, which I cannot use with the instance_type t2.micro I want to use in a vpc'ed environment.

In essence, this should work:

with_data_center 'eu-west-1' do
  machine "esc_poc_aws_driver" do
    machine_options :bootstrap_options => {
      :key_name => 'chefserver', 
      :image_id => 'ami-60a10117', # ubuntu/images/hvm/ubuntu-precise-12.04-amd64-server-20140927
      :instance_type => 't2.micro',
      :subnet => 'subnet-0a935c6f'
    }
  end
end

But does not:

[..]
[2014-12-26T02:03:15+01:00] DEBUG: Choosing default AMI for region 'eu-west-1'
[2014-12-26T02:03:15+01:00] DEBUG: AWS Bootstrap options: {:key_name=>"chefserver", :image_id=>"ami-4ab46b3d", :instance_type=>"t2.micro", :subnet=>"subnet-0a935c6f"}
[2014-12-26T02:03:15+01:00] DEBUG: Creating instance with bootstrap options {:key_name=>"chefserver", :image_id=>"ami-4ab46b3d", :instance_type=>"t2.micro", :subnet=>"subnet-0a935c6f"}


    ================================================================================
    Error executing action `converge` on resource 'machine[esc_poc_aws_driver]'
    ================================================================================

    AWS::EC2::Errors::InvalidParameterCombination
    ---------------------------------------------
    Virtualization type 'hvm' is required for instances of type 't2.micro'.
[..]

As you can see here, :image_id => 'ami-60a10117' has been superseded by the region's default :image_id=>"ami-4ab46b3d" and always will due to this bug.

As for the bootstrap_options, they are quite different to those of the fog::AWS driver. I will open another issue on that front.

Really looking forward to have your PR merged!

@esciara
Copy link

esciara commented Dec 26, 2014

For info, workaround for this:

with_data_center 'eu-west-1' do
  machine "esc_poc_aws_driver" do
    options = {:bootstrap_options => {
      :key_name => 'chefserver', 
      :instance_type => 't2.micro',
      :subnet => 'subnet-0a935c6f'
    },
     :image_id => 'ami-60a10117'}
    machine_options options
  end
end

@miguelcnf
Copy link
Contributor Author

That's pretty much the workaround I've used until now - setting the image_id it as a machine option instead of bootstrap.

I had that exact same problem as I wanted to spin up instances inside a vpc.

@jkeiser
Copy link
Contributor

jkeiser commented Feb 9, 2015

#89 checked in to fix this.

@jkeiser jkeiser closed this as completed Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants