Merge "Add ENA support option on uploaded AWS images"

This commit is contained in:
Zuul 2022-08-31 20:57:30 +00:00 committed by Gerrit Code Review
commit f670c53a56
3 changed files with 20 additions and 0 deletions

View File

@ -383,6 +383,21 @@ Selecting the ``aws`` driver adds the following options to the
long-standing issue with ``ansible_shell_type`` in combination
with ``become``.
.. attr:: architecture
:type: str
:default: x86_64
The architecture of the image. See the `AWS RegisterImage API
documentation`_ for valid values.
.. attr:: ena-support
:type: bool
:default: True
Whether the image has support for the AWS Enhanced Networking
Adapter (ENA). Many newer operating systems include driver
support as standard and some AWS instance types require it.
.. attr:: volume-type
:type: str
:default: gp2
@ -673,3 +688,4 @@ Selecting the ``aws`` driver adds the following options to the
.. _`Boto describe images`: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_images
.. _`VM Import/Export service role`: https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-role
.. _`instance quotas`: https://us-west-1.console.aws.amazon.com/servicequotas/home/services/ec2/quotas
.. _`AWS RegisterImage API documentation`: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RegisterImage.html

View File

@ -472,6 +472,7 @@ class AwsAdapter(statemachine.Adapter):
],
RootDeviceName='/dev/sda1',
VirtualizationType='hvm',
EnaSupport=provider_image.ena_support,
Name=image_name,
)

View File

@ -101,6 +101,7 @@ class AwsProviderDiskImage(ConfigValue):
default_port_mapping.get(self.connection_type, 22))
self.meta = image.get('tags', {})
self.architecture = image.get('architecture', 'x86_64')
self.ena_support = image.get('ena-support', True)
self.volume_size = image.get('volume-size', None)
self.volume_type = image.get('volume-type', 'gp2')
@ -119,6 +120,8 @@ class AwsProviderDiskImage(ConfigValue):
'connection-port': int,
'python-path': str,
'shell-type': str,
'architecture': str,
'ena-support': bool,
'volume-size': int,
'volume-type': str,
'tags': dict,