[Openstack] Request for help - Heat Auto-scaling

m.channappa.negalur at accenture.com m.channappa.negalur at accenture.com
Thu Mar 13 06:13:56 UTC 2014


Hello Jay,

Even I was getting the similar problem. I am able to launch stack, but autoscaling not happening , sample Template was given by 'eglynn at redhat.com'


Wwhen my  CPU load increases , autoscaling should happen according to the template.
But Ceiolmeter is not producing any alarm or notification...I am unable to check that and I am not getting package as well . check below link

Ceilometer error:
https://answers.launchpad.net/ubuntu/+source/ceilometer/+question/245076


Autoscaling erro details:
I was working with auto scaling part sample template given by you .
https://github.com/asalkeld/autoscaling-testing/blob/master/Ceilometer/template.yaml

But I welcomed with error

2014-03-12 05:29:30.864 933 TRACE heat.engine.resource     string = string.replace(k, v)
2014-03-12 05:29:30.864 933 TRACE heat.engine.resource TypeError: coercing to Unicode: need string or buffer, int found
2014-03-12 05:29:30.864 933 TRACE heat.engine.resource
2014-03-12 05:29:30.878 933 WARNING heat.engine.service [-] Stack create failed, status FAILED

Any suggestions ...where I am doing a mistake?

edited template:

HeatTemplateFormatVersion: '2012-12-12'
Description: |
  Template which tests autoscaling
Parameters:
  KeyName:
    Type: String
    Default: heat_key
  InstanceType:
    Type: String
    Default: m1.small
  ImageId:
    Type: String
    Default: F17-x86_64-cfntools
  StackStart:
    Description: Epoch seconds when the stack was launched
    Type: Number
    Default: 10
  ConsumeStopSeconds:
    Description: Seconds after StackStart when memory should be released
    Type: Number
    Default: 20
Resources:
  SmokeSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Standard firewall rules
      SecurityGroupIngress:
      - {IpProtocol: icmp, FromPort: '-1', ToPort: '-1', CidrIp : 0.0.0.0/0}
      - {IpProtocol: tcp, FromPort: '22', ToPort: '22', CidrIp: 0.0.0.0/0}
      - {IpProtocol: tcp, FromPort: '22', ToPort: '22', CidrIp: 0.0.0.0/0}
      - {IpProtocol: tcp, FromPort: '80', ToPort: '80', CidrIp: 0.0.0.0/0}
  ServerGroup:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      AvailabilityZones: {'Fn::GetAZs': ''}
      LaunchConfigurationName: {Ref: LaunchConfig}
      MinSize: '1'
      MaxSize: '3'
      Tags:
      - {Key: metering.server_group, Value: ServerGroup}
  ServerScaleUpPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    Properties:
      AdjustmentType: ChangeInCapacity
      AutoScalingGroupName: {Ref: ServerGroup}
      Cooldown: '60'
      ScalingAdjustment: '1'
  ServerScaleDownPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    Properties:
      AdjustmentType: ChangeInCapacity
      AutoScalingGroupName: {Ref: ServerGroup}
      Cooldown: '60'
      ScalingAdjustment: '-1'
  CPUAlarmHigh:
    Type: OS::Ceilometer::Alarm ------------------------------------------> instead of metering I have added Ceilometer

    Properties:
      description: Scale-up if the average CPU > 50% for 1 minute
      counter_name: cpu_util
      statistic: avg
      period: '60'
      evaluation_periods: '1'
      threshold: '60'
      alarm_actions:
      - {"Fn::GetAtt": [ServerScaleUpPolicy, AlarmUrl]}
      matching_metadata: {'metadata.user_metadata.server_group': 'ServerGroup'}
      comparison_operator: gt
  CPUAlarmLow:
    Type: OS::Ceilometer::Alarm ------------------------------------------> instead of metering I have added Ceilometer
    Properties:
      description: Scale-down if the average CPU < 15% for 1 minute
      counter_name: cpu_util
      statistic: avg
      period: '60'
      evaluation_periods: '1'
      threshold: '20'
      alarm_actions:
      - {"Fn::GetAtt": [ServerScaleDownPolicy, AlarmUrl]}
      matching_metadata: {'metadata.user_metadata.server_group': 'ServerGroup'}
      comparison_operator: lt
  LaunchConfig:
    Type: AWS::AutoScaling::LaunchConfiguration
    Metadata:
      AWS::CloudFormation::Init:
        config:
          files:
            /root/consume_memory:
              content:
                Fn::Replace:
                - StackStart: {Ref: StackStart}
                  ConsumeStopSeconds: {Ref: ConsumeStopSeconds}
                - |
                  #!/usr/bin/env python
                  from subprocess import call
                  import time
                  while time.time() < StackStart + ConsumeStopSeconds:
                      call(["timeout", "8", "cat /dev/zero > /dev/null"])
              mode: '000700'
              owner: root
              group: root
    Properties:
      ImageId: {Ref: ImageId}
      InstanceType: {Ref: InstanceType}
      KeyName: {Ref: KeyName}
      SecurityGroups: [{Ref: SmokeSecurityGroup}]
      UserData:
        Fn::Base64:
          Fn::Replace:
          - 'AWS::StackName': {Ref: 'AWS::StackName'}
            'AWS::Region': {Ref: 'AWS::Region'}
          - |
            #!/bin/bash -v
            /opt/aws/bin/cfn-init -s AWS::StackName -r LaunchConfig --region AWS::Region
            # yum make-cache gobbles up the whole of root.
            rm -rf /var/cache/yum/
            # report on memory consumption every 4 seconds
            at -f /root/watch_loop now
            # ramp up memory consumption until it is over 70%
            # then exits ConsumeStopSeconds seconds after stack launch
            /root/consume_memory &



From: Jay Lau [mailto:jay.lau.513 at gmail.com]
Sent: Thursday, March 13, 2014 11:28 AM
To: Micheal
Cc: openstack at lists.openstack.org
Subject: Re: [Openstack] Request for help - Heat Auto-scaling

Hey Michael,
It would be more helpful if you can attach your whole template for troubleshooting, did you define AutoScaling::ScalingPolicy for your AWS::AutoScaling::AutoScalingGroup?

Thanks,
Jay

2014-03-13 13:29 GMT+08:00 Micheal <pannov.tsth at gmail.com<mailto: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!

_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack



--
Thanks,
Jay

________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140313/194a4756/attachment.html>


More information about the Openstack mailing list