openstudio-aws 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstudio/aws/aws.rb +8 -2
- data/lib/openstudio/aws/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 699415a56f0293421b14a37ba67b5111aa5052bd
|
4
|
+
data.tar.gz: 810e3e506a8c02bbe90b51926cace86195c64a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48dea35a21a4c763bf31eeb6b2316349001c300fe92a2c62924b530c30a99607ce88bd4068b0eec91c7bec6b46f88ccef25ea0a0bef67a81fb85eaa6db123512
|
7
|
+
data.tar.gz: 2d6c65e2adfd51d7c21e1856b5f35ba728624a2fb4104919c1c1b366f3f0826d3b8f1708fa5ef46ea8ad2b357950c07e8e9c060321d3a701a83357ebcf2db1a1
|
data/lib/openstudio/aws/aws.rb
CHANGED
@@ -60,11 +60,17 @@ module OpenStudio
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def create_workers(number_of_instances, instance_data = {})
|
63
|
-
defaults = {instance_type: "m2.4xlarge"
|
63
|
+
defaults = {instance_type: "m2.4xlarge"}
|
64
64
|
instance_data = defaults.merge(instance_data)
|
65
65
|
|
66
|
+
if instance_data[:image_id].nil?
|
67
|
+
if instance_data[:instance_type] =~ /cc2|c3/
|
68
|
+
instance_data[:image_id] = @default_amis['cc2worker']
|
69
|
+
else
|
70
|
+
instance_data[:image_id] = @default_amis['worker']
|
71
|
+
end
|
72
|
+
end
|
66
73
|
|
67
|
-
#todo: raise an exception if the instance type and image id don't match
|
68
74
|
raise "Can't create workers without a server instance running" if @os_aws.server.nil?
|
69
75
|
|
70
76
|
@os_aws.launch_workers(instance_data[:image_id], instance_data[:instance_type], number_of_instances)
|