Removed placement and added subnet_id to run_instances. Added

the subnet id of the subnet in the default VPC.

Change-Id: Iec923d7929209bd9329290731c8d37047f1a4ab2
This commit is contained in:
Kashyap Kopparam 2014-12-15 17:44:54 +05:30
parent 42c6144b4d
commit 65b0482af3
2 changed files with 2 additions and 1 deletions

View File

@ -242,7 +242,7 @@ class EC2Driver(driver.ComputeDriver):
if user_data:
user_data = base64.b64decode(user_data)
reservation = self.ec2_conn.run_instances(aws_ami, instance_type=flavor_type, placement="us-east-1d",
reservation = self.ec2_conn.run_instances(aws_ami, instance_type=flavor_type, subnet_id=ec2_subnet_id,
user_data=user_data)
ec2_instance = reservation.instances

View File

@ -25,6 +25,7 @@ secure = True
aws_ami = "ami-785bae10"
#aws_ami = "ami-864d84ee"
instance_type = "t2.micro"
ec2_subnet_id = "subnet-e713cdbe"
# Mapping OpenStack's flavor IDs(which seems to be randomly assigned) to EC2's flavor names
flavor_map = {2: 't2.micro', 5: 't2.small', 1: 't2.medium', 3: 'c3.xlarge', 4: 'c3.2xlarge'}