[Openstack] Request for help - Heat Auto-scaling

Micheal pannov.tsth at gmail.com
Thu Mar 13 07:14:29 UTC 2014


Hello Jay,
  Thanks, here is my template:

{
  "AWSTemplateFormatVersion" : "2014-03-06",

  "Parameters" : {
    "InstanceType" : {
      "Description" : "WebServer EC2 instance type",
      "Type" : "String",
      "Default" : "m1.small",
      "ConstraintDescription" : "must be a valid EC2 instance type."
    },

    "WebServerPort" : {
      "Description" : "TCP/IP port of the web server",
      "Type" : "String",
      "Default" : "8888"
    },
    "KeyName" : {
      "Description" : "Name of an existing EC2 KeyPair to enable SSH access
to the instances",
      "Type" : "String",
      "Default" : "damonkey"
    }

  },

  "Resources" : {
    "WebServerGroup" : {
      "Type" : "AWS::AutoScaling::AutoScalingGroup",
      "Properties" : {
        "AvailabilityZones" : { "Fn::GetAZs" : "" },
        "LaunchConfigurationName" : { "Ref" : "LaunchConfig" },
        "MinSize" : "1",
        "MaxSize" : "3"
      }
    },
    "ScaleUpPolicy": {
      "Type": "AWS::AutoScaling::ScalingPolicy",
      "Properties": {
        "AdjustmentType": "ChangeInCapacity",
        "AutoScalingGroupName": "WebServerGroup",
        "Cooldown": "60",
        "ScalingAdjustment": "1"
      }
    },
    "ScaleDownPolicy": {
      "Type": "AWS::AutoScaling::ScalingPolicy",
      "Properties": {
        "AdjustmentType": "ChangeInCapacity",
        "AutoScalingGroupName": "WebServerGroup",
        "Cooldown": "60",
        "ScalingAdjustment": "-1"
      }
    },
    "CPUAlarmHigh": {
      "Type": "OS::Ceilometer::Alarm",
      "Properties": {
        "description": "Scale-up if CPU is greater than 90% for 10 seconds",
        "meter_name": "cpu_util",
        "statistic": "avg",
        "period": "10",
        "evaluation_periods": "1",
        "threshold": "90",
        "alarm_actions": [ {"Fn::GetAtt": ["ScaleUpPolicy", "AlarmUrl"]} ],
        "matching_metadata": {"metadata.user_metadata.server_group":
"WebServerGroup" },
        "comparison_operator": "gt"
      }
    },
    "CPUAlarmLow": {
      "Type": "OS::Ceilometer::Alarm",
      "Properties": {
        "description": "Scale-down if CPU is less than 50% for 10 seconds",
        "meter_name": "cpu_util",
        "statistic": "avg",
        "period": "10",
        "evaluation_periods": "1",
        "threshold": "50",
        "alarm_actions": [ {"Fn::GetAtt": ["ScaleDownPolicy", "AlarmUrl"]}
],
        "matching_metadata": {"metadata.user_metadata.server_group":
"WebServerGroup" },
        "comparison_operator": "lt"
      }
    },
    "LaunchConfig" : {
      "Type" : "AWS::AutoScaling::LaunchConfiguration",
      "Properties" : {
        "KeyName" : { "Ref" : "KeyName" },
        "ImageId" : "CirrOS 0.3.1",
        "UserData" : { "Fn::Base64" : { "Ref" : "WebServerPort" }},
        "SecurityGroups" : [ "default" ],
        "InstanceType" : { "Ref" : "InstanceType" }
      }
    }
  }

}


2014-03-13 13:29 GMT+08:00 Micheal <pannov.tsth at gmail.com>:

>   Does Heat support auto-scaling in Havana ? The cloudwatch seems to be
> deprecated, and the new mechanism with ceilometer seems not working either.
> I can create stack successfully, but the stack with
> AWS::AutoScaling::AutoScalingGroup can not auto-scaling as expected.
>   All replies appreciated, thanks!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140313/bc05a7ad/attachment.html>


More information about the Openstack mailing list