Advertisement
Guest User

Untitled

a guest
Jan 29th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. # This is a hello world HOT template just defining a single compute instance
  2. heat_template_version: 2013-05-23
  3.  
  4. description: Test-template
  5.  
  6. parameters:
  7. KeyName:
  8. type: string
  9. description: Name of an existing key pair to use for the instance
  10. InstanceType:
  11. type: string
  12. description: Instance type for the instance to be created
  13. default: m1.micro
  14. constraints:
  15. - allowed_values: [m1.micro]
  16. description: Value must be one of 'm1.micro'
  17. ImageId:
  18. type: string
  19. description: ID of the image to use for the instance
  20.  
  21. resources:
  22. group:
  23. type: AWS::AutoScaling::AutoScalingGroup
  24. properties:
  25. # Cooldown: '60'
  26. # DesiredCapacity: 7
  27. MinSize: '1'
  28. MaxSize: '5'
  29. LaunchConfigurationName: {Ref: launch}
  30. AvailabilityZones: {'Fn::GetAZs':''}
  31.  
  32. scaleUpPolicy:
  33. type: AWS::AutoScaling::ScalingPolicy
  34. properties:
  35. AutoScalingGroupName: {Ref: group} #Ref und Klammern hinzugefügt
  36. ScalingAdjustment: 1
  37. AdjustmentType: ChangeInCapacity
  38.  
  39. scaleDownPolicy:
  40. type: AWS::AutoScaling::ScalingPolicy
  41. properties:
  42. AutoScalingGroupName: {Ref: group} #Ref und Klammern hinzugefügt
  43. ScalingAdjustment: -1
  44. AdjustmentType: ChangeInCapacity
  45.  
  46. launch:
  47. type: AWS::AutoScaling::LaunchConfiguration
  48. properties:
  49. KeyName: { get_param: KeyName }
  50. InstanceType: { get_param: InstanceType }
  51. ImageId: {get_param: ImageId}
  52.  
  53. CPUAlarmHigh:
  54. type: OS::Ceilometer::Alarm
  55. properties:
  56. description: Scale-up if the average CPU > 70% for 60 Seconds
  57. meter_name: cpu_util
  58. statistic: avg
  59. period: '60'
  60. evaluation_periods: '1'
  61. threshold: '70'
  62. alarm_actions:
  63. - {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]}
  64. comparison_operator: gt
  65.  
  66. CPUAlarmLow:
  67. type: OS::Ceilometer::Alarm
  68. properties:
  69. description: Scale-down if the average CPU < 40% for 60 Seconds
  70. meter_name: cpu_util
  71. statistic: avg
  72. period: '60'
  73. evaluation_periods: '1'
  74. threshold: '40'
  75. alarm_actions:
  76. - {"Fn::GetAtt": [scaleDownPolicy, AlarmUrl]}
  77. comparison_operator: lt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement