-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow different instance type per role #2672
Changes from 5 commits
d3a1303
8e517bc
22bebce
6cedc8d
3fc1270
273a4eb
0c5738e
ab443b4
01571ce
a217689
9a3d3e6
96dba43
d4b1f67
74f4a75
686b120
c87aacf
9284db5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -754,12 +754,13 @@ def check_layout(layout, keyname) | |
raise AppScaleException.new(msg) | ||
end | ||
if !node['public_ip'] || !node['private_ip'] || !node['jobs'] || | ||
!node['instance_id'] | ||
!node['instance_id'] || !node['instance_type'] | ||
msg = "Error: node layout is missing information #{node}." | ||
Djinn.log_error(msg) | ||
raise AppScaleException.new(msg) | ||
elsif node['public_ip'].empty? || node['private_ip'].empty? || | ||
node['jobs'].empty? || node['instance_id'].empty? | ||
node['jobs'].empty? || node['instance_id'].empty? || | ||
node['instance_type'].empty? | ||
msg = "Error: node layout is missing information #{node}." | ||
Djinn.log_error(msg) | ||
raise AppScaleException.new(msg) | ||
|
@@ -1010,6 +1011,13 @@ def set_parameters(layout, options, secret) | |
@options['ec2_url'] = @options['EC2_URL'] | ||
end | ||
|
||
@nodes.each { |node| | ||
if node.jobs.include? 'compute' | ||
@options['compute_instance_type'] = node.instance_type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does that means that if we have multiple compute node with different instance type, we pick the last one as default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, so from an azure perspective, it was important to have the right instance type used for compute nodes, so that it could add to the specific scale set which was created for those existing compute nodes. In case of multiple compute nodes with different instance types specified in the ASF, I thought it would be fine to pick up any one of the compute instance types to be used for autoscaling because there would be no good way of determining which instance type they would actually want to use for that purpose. Unless we think we need an autoscaling_instance_type kind of parameter in the ASF. What do you think @obino ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it. Interesting the idea of a specific autoscaling instance kind: should we have one per role then (say one per compute, one per datastore etc..)? I like your first cut for now, so it's simple to understand it. |
||
break | ||
end | ||
} | ||
|
||
'OK' | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,6 +184,7 @@ def spawn_vms(num_vms, options, jobs, disks) | |
parameters['zone'] = options['zone'] | ||
parameters['region'] = options['region'] | ||
parameters['IS_VERBOSE'] = options['verbose'] | ||
parameters['instance_type'] = options ['compute_instance_type'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this be associated with the jobs type? that is, if job == compute (or job.include?(compute) or whatever trickery ruby uses) then do the assignment of the type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this spawn vms method is used only for autoscaling compute nodes right? So it just needs an instance type to be specified which it can use for autoscaling. At this point, I don't believe it would need another check to determine that. But I might need a check to see if it already has a default instance type specified outside of the ips layout, in which case it might override it. Will test that and update here. |
||
|
||
run_result = run_instances(parameters) | ||
Djinn.log_debug("[IM] Run instances info says [#{run_result}]") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any change in the AppScalefile for the new type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we would now specify the different instance types within the roles section of the ips layout.