From 4a58248ba7dde4c9dc803440fe5a1620c7a3f8a9 Mon Sep 17 00:00:00 2001 From: Matt Russell Date: Wed, 15 Jun 2016 12:00:43 +0100 Subject: [PATCH] Use new AMI image. - EBS storage for root volume. (60Gb, SSD) - Ephemeral instance-store storage for data/software to be installed. - Explicitly specify block device mappings when creating instance. --- src/azanium/awscloudops.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/azanium/awscloudops.py b/src/azanium/awscloudops.py index 45f5d22..564519e 100644 --- a/src/azanium/awscloudops.py +++ b/src/azanium/awscloudops.py @@ -25,11 +25,22 @@ # Instance settings based on image of default Amazon AMI (ami-f5f41398, 2016) EC2_INSTANCE_DEFAULTS = dict( - ami='ami-02d7136f', + ami='ami-4d925520', instance_type='r3.4xlarge', monitoring=True, dry_run=False) +BLOCK_DEVICE_MAPPINGS = [{ + 'DeviceName': '/dev/xvda', + 'Ebs': { + 'VolumeSize': 60, + 'DeleteOnTermination': True + }, +}, { + 'DeviceName': '/dev/xvdb', + 'VirtualName': 'ephemeral0' +}] + EC2_INSTANCE_ROLE = 'development' logger = log.get_logger(__name__) @@ -257,6 +268,7 @@ def init(ctx, ImageId=ami, InstanceType=instance_type, KeyName=key_pair.name, + BlockDeviceMappings=BLOCK_DEVICE_MAPPINGS, MinCount=1, MaxCount=1, UserData=base64.b64encode(user_data.encode('utf-8')),