Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- heat_template_version: 2013-05-23
- description: Scaling Policy test
- parameters:
- public_net_id:
- type: string
- description: >
- ID of public network for which floating IP addresses will be allocated
- private_net_id:
- type: string
- description: ID of private network into which servers get deployed
- private_subnet_id:
- type: string
- description: ID of private sub network into which servers get deployed
- resources:
- instance_group:
- type: OS::Heat::AutoScalingGroup
- properties:
- desired_capacity: 1
- min_size: 1
- max_size: 5
- resource:
- type: my_scaling_unit.yaml
- properties:
- key_name: psousaxenlab
- image: Cirros
- flavor: m1.tiny
- public_net_id: {get_param: public_net_id}
- private_net_id: {get_param: private_net_id}
- private_subnet_id: {get_param: private_subnet_id}
- metadata: {"metering.stack": {get_param: "OS::stack_id"}}
- web_server_scaleup_policy:
- type: OS::Heat::ScalingPolicy
- properties:
- adjustment_type: change_in_capacity
- auto_scaling_group_id: {get_resource: instance_group}
- cooldown: 60
- scaling_adjustment: 1
- web_server_scaledown_policy:
- type: OS::Heat::ScalingPolicy
- properties:
- adjustment_type: change_in_capacity
- auto_scaling_group_id: {get_resource: instance_group}
- cooldown: 60
- scaling_adjustment: -1
- cpu_alarm_high:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-up if the average CPU > 50% for 1 minute
- meter_name: cpu_util
- statistic: avg
- period: 60
- evaluation_periods: 1
- threshold: 50
- alarm_actions:
- - {get_attr: [web_server_scaleup_policy, alarm_url]}
- matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
- comparison_operator: gt
- repeat_actions: True
- cpu_alarm_low:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-down if the average CPU < 15% for 10 minutes
- meter_name: cpu_util
- statistic: avg
- period: 600
- evaluation_periods: 1
- threshold: 15
- alarm_actions:
- - {get_attr: [web_server_scaledown_policy, alarm_url]}
- matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
- comparison_operator: lt
- repeat_actions: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement