Browse Source

Removed placement and added subnet_id to run_instances. Added

the subnet id of the subnet in the default VPC.

Change-Id: Iec923d7929209bd9329290731c8d37047f1a4ab2
changes/78/141778/1
Kashyap Kopparam 4 years ago
parent
commit
65b0482af3
2 changed files with 2 additions and 1 deletions
  1. 1
    1
      ec2driver.py
  2. 1
    0
      ec2driver_standard_config.py

+ 1
- 1
ec2driver.py View File

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

+ 1
- 0
ec2driver_standard_config.py View File

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

Loading…
Cancel
Save