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

block_device_mappings setting is not optional #100

Closed
volker-fr opened this issue Feb 19, 2015 · 4 comments
Closed

block_device_mappings setting is not optional #100

volker-fr opened this issue Feb 19, 2015 · 4 comments

Comments

@volker-fr
Copy link

In the current HEAD the block_device_mappings is required. This was not the case before which I personally would have preferred.

Beside this I run into errors when I do not set all block_device_mapping configuration settings. In my humble opinion some default settings should be assumed for all entire block_device_mappings settings.

This configuration works:

        block_device_mappings:
            - ebs_device_name: /dev/sda1
              ebs_volume_size: 8
              ebs_delete_on_termination: true

No block_device_mappings et al:

% kitchen converge ec2
-----> Starting Kitchen (v1.3.1)
-----> Creating <default-ec2>...
       Creating <>...
       If you are not using an account that qualifies under the AWS
       free-tier, you may be charged to run these suites. The charge
       should be minimal, but neither Test Kitchen nor its maintainers
       are responsible for your incurred costs.
>>>>>> Create failed on instance <default-ec2>.
>>>>>> Please see .kitchen/logs/default-ec2.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: InvalidBlockDeviceMapping => Missing device name

Only ebs_device_name:

        block_device_mappings:
            - ebs_device_name: /dev/sda1
#              ebs_volume_size: 8
#              ebs_delete_on_termination: true

leads to

% kitchen converge ec2
-----> Starting Kitchen (v1.3.1)
/Users/myuser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.8.1.dev/lib/kitchen/driver/ec2.rb:93:in `block (2 levels) in <class:Ec2>': Every :block_device_mapping must include the keys :ebs_volume_size, :ebs_delete_on_termination and :ebs_device_name (RuntimeError)
    from /Users/myuser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.8.1.dev/lib/kitchen/driver/ec2.rb:89:in `each'
[...]

No ebs_delete_on_termination:

        block_device_mappings:
            - ebs_device_name: /dev/sda1
              ebs_volume_size: 8
#              ebs_delete_on_termination: true

leads to

% kitchen converge ec2
-----> Starting Kitchen (v1.3.1)
/Users/myuser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.8.1.dev/lib/kitchen/driver/ec2.rb:93:in `block (2 levels) in <class:Ec2>': Every :block_device_mapping must include the keys :ebs_volume_size, :ebs_delete_on_termination and :ebs_device_name (RuntimeError)
    from /Users/myuser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.8.1.dev/lib/kitchen/driver/ec2.rb:89:in `each'
[...]
@ajmath
Copy link

ajmath commented Mar 13, 2015

Just ran into this issue as well.

@toddmichael
Copy link

Bit me tonight too. Thanks for posting. Saved me a lot of frustration.

@tyler-ball
Copy link
Contributor

This should be fixed in the latest release of kitchen-ec2 (0.9.0) - please try that and let me know if you're still experiencing issues!

If no block_device_mappings are provided then we default to a single disc with 8GB of data. The current logic requires you to provide :ebs_volume_size, :ebs_delete_on_termination and :ebs_device_name if you want to add a custom disc.

It seems reasonable that we could default these fields if users don't want to specify all 3 of them. I'll file an issue so that a configuration like the following would work:

block_device_mappings:
  - ebs_device_name: /dev/sda1
    # ebs_volume_size will be defaulted to 8
    # ebs_delete_on_termination will be defaulted to true

It seems reasonable to think that :ebs_device_name will still be required. Sound good?

@tyler-ball
Copy link
Contributor

New Issue - #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants