Advertisement
Guest User

Untitled

a guest
Jun 16th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 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.giust
  14. constraints:
  15. - allowed_values: [m1.giust]
  16. description: Value must be one of 'm1.giust'
  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: 3
  27. MinSize: '1'
  28. MaxSize: '5'
  29. LaunchConfigurationName: {Ref: launch}
  30. AvailabilityZones: {'Fn::GetAZs':''}
  31. Tags:
  32. - {Key: metering.server_group, Value: group}
  33.  
  34. scaleUpPolicy:
  35. type: AWS::AutoScaling::ScalingPolicy
  36. properties:
  37. AutoScalingGroupName: {Ref: group} # NO UTF8
  38. ScalingAdjustment: 1
  39. AdjustmentType: ChangeInCapacity
  40.  
  41. scaleDownPolicy:
  42. type: AWS::AutoScaling::ScalingPolicy
  43. properties:
  44. AutoScalingGroupName: {Ref: group} #NO UTF8
  45. ScalingAdjustment: -1
  46. AdjustmentType: ChangeInCapacity
  47.  
  48. launch:
  49. type: AWS::AutoScaling::LaunchConfiguration
  50. properties:
  51. KeyName: { get_param: KeyName }
  52. InstanceType: { get_param: InstanceType }
  53. ImageId: {get_param: ImageId}
  54.  
  55. CPUAlarmHigh:
  56. type: OS::Ceilometer::Alarm
  57. properties:
  58. description: Scale-up if the average CPU more than 70 for 60 Seconds
  59. meter_name: cpu_util
  60. statistic: avg
  61. period: '60'
  62. evaluation_periods: '1'
  63. repeat_actions: true
  64. threshold: '70'
  65. alarm_actions:
  66. - {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]}
  67. matching_metadata: {'metadata.user_metadata.server_group': 'group'}
  68. comparison_operator: gt
  69.  
  70.  
  71. CPUAlarmLow:
  72. type: OS::Ceilometer::Alarm
  73. properties:
  74. description: Scale-down if the average CPU less than 40 for 60 Seconds
  75. meter_name: cpu_util
  76. statistic: avg
  77. period: '60'
  78. evaluation_periods: '1'
  79. repeat_actions: true
  80. threshold: '40'
  81. alarm_actions:
  82. - {"Fn::GetAtt": [scaleDownPolicy, AlarmUrl]}
  83. matching_metadata: {'metadata.user_metadata.server_group': 'group'}
  84. comparison_operator: lt
  85.  
  86. #outputs:
  87. # instance_ip:
  88. # description: The IP address of the deployed instance
  89. # value: { get_attr: [instance, PublicIp] }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement