Advertisement
Guest User

Untitled

a guest
May 12th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. heat_template_version: 2013-05-23
  2. description: Scaling Policy test
  3. parameters:
  4. public_net_id:
  5. type: string
  6. description: >
  7. ID of public network for which floating IP addresses will be allocated
  8. private_net_id:
  9. type: string
  10. description: ID of private network into which servers get deployed
  11. private_subnet_id:
  12. type: string
  13. description: ID of private sub network into which servers get deployed
  14.  
  15.  
  16.  
  17.  
  18. resources:
  19. instance_group:
  20. type: OS::Heat::AutoScalingGroup
  21. properties:
  22. desired_capacity: 1
  23. min_size: 1
  24. max_size: 5
  25. resource:
  26. type: my_scaling_unit.yaml
  27. properties:
  28. key_name: psousaxenlab
  29. image: Cirros
  30. flavor: m1.tiny
  31. public_net_id: {get_param: public_net_id}
  32. private_net_id: {get_param: private_net_id}
  33. private_subnet_id: {get_param: private_subnet_id}
  34. metadata: {"metering.stack": {get_param: "OS::stack_id"}}
  35.  
  36. web_server_scaleup_policy:
  37. type: OS::Heat::ScalingPolicy
  38. properties:
  39. adjustment_type: change_in_capacity
  40. auto_scaling_group_id: {get_resource: instance_group}
  41. cooldown: 60
  42. scaling_adjustment: 1
  43. web_server_scaledown_policy:
  44. type: OS::Heat::ScalingPolicy
  45. properties:
  46. adjustment_type: change_in_capacity
  47. auto_scaling_group_id: {get_resource: instance_group}
  48. cooldown: 60
  49. scaling_adjustment: -1
  50. cpu_alarm_high:
  51. type: OS::Ceilometer::Alarm
  52. properties:
  53. description: Scale-up if the average CPU > 50% for 1 minute
  54. meter_name: cpu_util
  55. statistic: avg
  56. period: 60
  57. evaluation_periods: 1
  58. threshold: 50
  59. alarm_actions:
  60. - {get_attr: [web_server_scaleup_policy, alarm_url]}
  61. matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
  62. comparison_operator: gt
  63. repeat_actions: True
  64. cpu_alarm_low:
  65. type: OS::Ceilometer::Alarm
  66. properties:
  67. description: Scale-down if the average CPU < 15% for 10 minutes
  68. meter_name: cpu_util
  69. statistic: avg
  70. period: 600
  71. evaluation_periods: 1
  72. threshold: 15
  73. alarm_actions:
  74. - {get_attr: [web_server_scaledown_policy, alarm_url]}
  75. matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
  76. comparison_operator: lt
  77. repeat_actions: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement