diff --git a/ec2driver.py b/ec2driver.py index 7dad852..b83f5bb 100644 --- a/ec2driver.py +++ b/ec2driver.py @@ -147,6 +147,7 @@ class EC2Driver(driver.ComputeDriver): def spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): #Creating the EC2 instance + instance_type = flavor_map[instance.get_flavor().name] reservation = self.ec2_conn.run_instances(aws_ami, instance_type=instance_type) ec2_instance = reservation.instances instance['metadata'].update({'ec2_id':ec2_instance[0].id}) diff --git a/ec2driver_config.py b/ec2driver_config.py index 22d8715..255b23c 100644 --- a/ec2driver_config.py +++ b/ec2driver_config.py @@ -21,3 +21,9 @@ aws_secret_access_key = "FMld6m8kok9jpxBkORST5xfbZSod7mVm9ChDgttS" aws_ami = "ami-864d84ee" instance_type = "t2.micro" + +flavor_map={ 'm1.tiny':'t2.micro', + 'm1.small':'t2.small', + 'm1.medium':'t2.medium', + 'm1.large':'c3.xlarge', + 'm1.xlarge':'c3.2xlarge'}