|
|
|
@ -205,9 +205,9 @@ options:
|
|
|
|
version_added: "1.5"
|
|
|
|
version_added: "1.5"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- a list of hash/dictionaries of volumes to add to the new instance; '[{"key":"value", "key":"value"}]'; keys allowed
|
|
|
|
- a list of hash/dictionaries of volumes to add to the new instance; '[{"key":"value", "key":"value"}]'; keys allowed
|
|
|
|
are - device_name (str; required), delete_on_termination (bool; False), device_type (deprecated), ephemeral (str),
|
|
|
|
are - device_name (str; required), delete_on_termination (bool; False), ephemeral (str),
|
|
|
|
encrypted (bool; False), snapshot (str), volume_type (str), volume_size (int, GiB), iops (int) - device_type
|
|
|
|
encrypted (bool; False), snapshot (str), volume_type (str), volume_size (int, GiB), iops (int) - iops must be set when
|
|
|
|
is deprecated use volume_type, iops must be set when volume_type='io1', ephemeral and snapshot are mutually exclusive.
|
|
|
|
volume_type='io1', ephemeral and snapshot are mutually exclusive.
|
|
|
|
type: list
|
|
|
|
type: list
|
|
|
|
ebs_optimized:
|
|
|
|
ebs_optimized:
|
|
|
|
version_added: "1.6"
|
|
|
|
version_added: "1.6"
|
|
|
|
@ -787,17 +787,7 @@ def create_block_device(module, ec2, volume):
|
|
|
|
# http://aws.amazon.com/about-aws/whats-new/2013/10/09/ebs-provisioned-iops-maximum-iops-gb-ratio-increased-to-30-1/
|
|
|
|
# http://aws.amazon.com/about-aws/whats-new/2013/10/09/ebs-provisioned-iops-maximum-iops-gb-ratio-increased-to-30-1/
|
|
|
|
MAX_IOPS_TO_SIZE_RATIO = 30
|
|
|
|
MAX_IOPS_TO_SIZE_RATIO = 30
|
|
|
|
|
|
|
|
|
|
|
|
# device_type has been used historically to represent volume_type,
|
|
|
|
volume_type = volume.get('volume_type')
|
|
|
|
# however ec2_vol uses volume_type, as does the BlockDeviceType, so
|
|
|
|
|
|
|
|
# we add handling for either/or but not both
|
|
|
|
|
|
|
|
if all(key in volume for key in ['device_type', 'volume_type']):
|
|
|
|
|
|
|
|
module.fail_json(msg='device_type is a deprecated name for volume_type. Do not use both device_type and volume_type')
|
|
|
|
|
|
|
|
if 'device_type' in volume:
|
|
|
|
|
|
|
|
module.deprecate('device_type is deprecated for block devices - use volume_type instead',
|
|
|
|
|
|
|
|
version=2.9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# get whichever one is set, or NoneType if neither are set
|
|
|
|
|
|
|
|
volume_type = volume.get('device_type') or volume.get('volume_type')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'snapshot' not in volume and 'ephemeral' not in volume:
|
|
|
|
if 'snapshot' not in volume and 'ephemeral' not in volume:
|
|
|
|
if 'volume_size' not in volume:
|
|
|
|
if 'volume_size' not in volume:
|
|
|
|
|