Merge "Add 'cooldown' attribute to scaling policy"
This commit is contained in:
commit
db5a60659b
@ -79,11 +79,13 @@ class AutoscalingTest(TestCase):
|
||||
max_instances: 10
|
||||
default_instances: 3
|
||||
increment: 1
|
||||
cooldown: 60
|
||||
'''
|
||||
|
||||
expectedprops = {'desired_capacity': 3,
|
||||
'max_size': 10,
|
||||
'min_size': 2,
|
||||
'cooldown': 60,
|
||||
'resource': {'type': 'asg_res.yaml'}}
|
||||
|
||||
self._tosca_scaling_test(
|
||||
|
@ -94,6 +94,8 @@ class ToscaAutoscaling(HotResource):
|
||||
self.properties["adjustment_type"] = "change_in_capacity "
|
||||
self.properties["scaling_adjustment"] = self.\
|
||||
policy.entity_tpl["properties"]["increment"]
|
||||
self.properties["cooldown"] =\
|
||||
self.policy.entity_tpl["properties"]["cooldown"]
|
||||
delete_res_names = []
|
||||
scale_res = []
|
||||
for index, resource in enumerate(resources):
|
||||
@ -105,6 +107,7 @@ class ToscaAutoscaling(HotResource):
|
||||
res["min_size"] = temp["min_instances"]
|
||||
res["max_size"] = temp["max_instances"]
|
||||
res["desired_capacity"] = temp["default_instances"]
|
||||
res["cooldown"] = temp["cooldown"]
|
||||
props['type'] = resource.type
|
||||
props['properties'] = resource.properties
|
||||
res['resource'] = {'type': self.policy.name + '_res.yaml'}
|
||||
|
@ -38,3 +38,4 @@ topology_template:
|
||||
max_instances: 10
|
||||
default_instances: 3
|
||||
increment: 1
|
||||
cooldown: 60
|
||||
|
@ -10,6 +10,7 @@ resources:
|
||||
properties:
|
||||
min_size: 2
|
||||
desired_capacity: 3
|
||||
cooldown: 60
|
||||
resource:
|
||||
type: asg_res.yaml
|
||||
max_size: 10
|
||||
@ -20,6 +21,7 @@ resources:
|
||||
get_resource: asg_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: 1
|
||||
cooldown: 60
|
||||
asg_scale_in:
|
||||
type: OS::Heat::ScalingPolicy
|
||||
properties:
|
||||
@ -27,6 +29,7 @@ resources:
|
||||
get_resource: asg_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: -1
|
||||
cooldown: 60
|
||||
asg_alarm:
|
||||
type: OS::Aodh::Alarm
|
||||
properties:
|
||||
|
@ -12,6 +12,7 @@ resources:
|
||||
get_resource: asg_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: 1
|
||||
cooldown: 60
|
||||
low_cpu_usage:
|
||||
type: OS::Aodh::Alarm
|
||||
properties:
|
||||
@ -30,6 +31,7 @@ resources:
|
||||
resource:
|
||||
type: asg_res.yaml
|
||||
max_size: 10
|
||||
cooldown: 60
|
||||
asg_scale_in:
|
||||
type: OS::Heat::ScalingPolicy
|
||||
properties:
|
||||
@ -37,6 +39,7 @@ resources:
|
||||
get_resource: asg_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: -1
|
||||
cooldown: 60
|
||||
high_cpu_usage:
|
||||
type: OS::Aodh::Alarm
|
||||
properties:
|
||||
|
@ -12,6 +12,7 @@ resources:
|
||||
get_resource: SP1_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: 1
|
||||
cooldown: 120
|
||||
SP1_group:
|
||||
type: OS::Heat::AutoScalingGroup
|
||||
properties:
|
||||
@ -20,6 +21,7 @@ resources:
|
||||
resource:
|
||||
type: SP1_res.yaml
|
||||
max_size: 3
|
||||
cooldown: 120
|
||||
SP1_scale_in:
|
||||
type: OS::Heat::ScalingPolicy
|
||||
properties:
|
||||
@ -27,4 +29,5 @@ resources:
|
||||
get_resource: SP1_group
|
||||
adjustment_type: change_in_capacity
|
||||
scaling_adjustment: -1
|
||||
cooldown: 120
|
||||
outputs: {}
|
@ -30,6 +30,7 @@ topology_template:
|
||||
max_instances: 10
|
||||
default_instances: 3
|
||||
increment: 1
|
||||
cooldown: 60
|
||||
|
||||
- cpu_monitoring:
|
||||
type: tosca.policies.Monitoring
|
||||
|
Loading…
Reference in New Issue
Block a user