From ee7ad22137b9e98ac6cb75a2c855926c10f4a735 Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Tue, 23 Jun 2015 16:58:43 -0700 Subject: [PATCH 1/2] Adding block_device_mapping iops parameter, necessary when specifying volume_type of io1 --- README.md | 8 +++++++- lib/kitchen/driver/aws/instance_generator.rb | 1 + .../driver/ec2/instance_generator_spec.rb | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fb8d443d..1c011336b 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,11 @@ block_device_mappings: ebs_volume_size: 15 ebs_delete_on_termination: true ebs_snapshot_id: snap-0015d0bc + - ebs_device_name: /dev/sdc + ebs_volume_size: 100 + ebs_delete_on_termination: true + ebs_volume_type: io1 + ebs_iops: 100 ``` The keys `ebs_device_name`, `ebs_volume_size` and `ebs_delete_on_termination` are required for every mapping. @@ -280,7 +285,8 @@ storage config keys are present. The keys `ebs_volume_type`, `ebs_virtual_name` and `ebs_snapshot_id` are optional. See [Amazon EBS Volume Types](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) to find out more about -volume types. `ebs_volume_type` defaults to `standard` but can also be `gp2` or `io1`. +volume types. `ebs_volume_type` defaults to `standard` but can also be `gp2` or `io1`. If you specify `io1` you must +also specify `ebs_iops`. If you have a block device mapping with a `ebs_device_name` equal to the root storage device name on your [image](#config-image-id) then the provided mapping will replace the settings in the image. diff --git a/lib/kitchen/driver/aws/instance_generator.rb b/lib/kitchen/driver/aws/instance_generator.rb index d31d6cb59..f03d4adbe 100644 --- a/lib/kitchen/driver/aws/instance_generator.rb +++ b/lib/kitchen/driver/aws/instance_generator.rb @@ -110,6 +110,7 @@ def block_device_mappings # rubocop:disable all :device_name => bdm[:ebs_device_name] } b[:ebs][:volume_type] = bdm[:ebs_volume_type] if bdm[:ebs_volume_type] + b[:ebs][:iops] = bdm[:ebs_iops] if bdm[:ebs_iops] b[:ebs][:snapshot_id] = bdm[:ebs_snapshot_id] if bdm[:ebs_snapshot_id] b[:virtual_name] = bdm[:ebs_virtual_name] if bdm[:ebs_virtual_name] b diff --git a/spec/kitchen/driver/ec2/instance_generator_spec.rb b/spec/kitchen/driver/ec2/instance_generator_spec.rb index df73b92e1..98058cf5a 100644 --- a/spec/kitchen/driver/ec2/instance_generator_spec.rb +++ b/spec/kitchen/driver/ec2/instance_generator_spec.rb @@ -114,6 +114,13 @@ :ebs_volume_type => "gp2", :ebs_snapshot_id => "id", :ebs_virtual_name => "test" + }, + { + :ebs_volume_size => 100, + :ebs_delete_on_termination => true, + :ebs_device_name => "/dev/sda3", + :ebs_volume_type => "io1", + :ebs_iops => 100 } ] } end @@ -137,6 +144,15 @@ }, :device_name => "/dev/sda2", :virtual_name => "test" + }, + { + :ebs => { + :volume_size => 100, + :volume_type => "io1", + :iops => 100, + :delete_on_termination => true + }, + :device_name => "/dev/sda3" } ] ) From 61fce76f9d88b896edfe63b38ee09189490c5d62 Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Tue, 23 Jun 2015 17:01:08 -0700 Subject: [PATCH 2/2] Updating CHANGELOG for #165 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b461338d3..bcf6eb37a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Bug Fixes +* Pull Request #165: Added `ebs_iops` parameter to block_device_mappings, necessary when specifying volume type of `io1` + ### New Features * Pull Request [#150][]: Added support for managing Windows hosts in AWS