Ask Your Question
1

AutoScaling fails on multiple networks?

asked 2014-01-09 19:11:52 -0500

tianzhenhua gravatar image

updated 2014-01-10 14:29:51 -0500

smaffulli gravatar image

I have a problem about openstack autoscaling by template! I have added 4 network in my sysytem (from horizon web portal):

            Int_1 172.168.1.0/24;
            Int_2 172.168.0.0/24;
            subnet_heat_one 80.80.80.0/24;
            ext_subnet 10.144.146.0/23;

I wrote autoscaling template and want to test autoscaling function and the template as follow:

        HeatTemplateFormatVersion: '2012-12-12'

        Description: Creates an autoscaling wordpress application using Ceilometer.

        Parameters:
          KeyName:
            Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
            Type: String
            Default: yuy`enter code here`
          InstanceType:
            Description: WebServer EC2 instance type
            Type: String
            Default: m1.small
            AllowedValues: [m1.tiny, m1.small, m1.medium, m1.large, m1.xlarge]
            ConstraintDescription: must be a valid EC2 instance type.
          ImageId:
            Description: the name or uuid of the image in glance
            Type: String
            Default: ba8b2f35-b539-40b0-a620-e5ac2fde3fa6
          SubNetID:
            Description: Sub Net ID
            Type: String
            Default: 88e8f6c7-40dc-4531-870f-10b51f8a36b3
        Resources:
          Server1:
            Type: OS::Nova::Server
            Properties:
              name: Test
              image: { Ref: ImageId }
              flavor:  { Ref: InstanceType }
              key_name:  { Ref: KeyName }
              networks: [{"network": "network1", "fixed_ip": 172.168.0.4, "port": { Ref: Server1_port }, "uuid": "123"}, {"network": "network2", "fixed_ip": 172.168.1.4, "port": { Ref: Server2_port }, "uuid": "456"}, {"network": "network3", "fixed_ip": 80.80.80.10, "port": { Ref: Server3_port }, "uuid": "789"}]
          Server1_port:
            Type: OS::Neutron::Port
            Properties:
              network_id: b19903d5-f9a4-4913-8d0a-f7f1fdaf1087
              fixed_ips:
                - subnet_id: 1fff77cf-8303-4d0f-8ce4-889fa29daedf
          Server2_port:
            Type: OS::Neutron::Port
            Properties:
              network_id: a19c4949-4e65-420d-816d-390c64c69332
              fixed_ips:
                - subnet_id: 1ed3ff85-2fe5-42bd-a885-ca8a001e0afc
          Server3_port:
            Type: OS::Neutron::Port
            Properties:
              network_id: e45caf67-3ef2-4ee6-a3a0-726a7349be4f
              fixed_ips:
                - subnet_id: 88e8f6c7-40dc-4531-870f-10b51f8a36b3 
                - ip_address: 80.80.80.10   
          WebServerGroup:
            Type: AWS::AutoScaling::AutoScalingGroup
            Properties:
              AvailabilityZones: {'Fn::GetAZs': ''}
              LaunchConfigurationName: {Ref: LaunchConfig}
              MinSize: '1'
              MaxSize: '3'
          WebServerScaleUpPolicy:
            Type: AWS::AutoScaling::ScalingPolicy
            Properties:
              AdjustmentType: ChangeInCapacity
              AutoScalingGroupName: {Ref: WebServerGroup}
              Cooldown: '60'
              ScalingAdjustment: '1'
          WebServerScaleDownPolicy:
            Type: AWS::AutoScaling::ScalingPolicy
            Properties:
              AdjustmentType: ChangeInCapacity
              AutoScalingGroupName: {Ref: WebServerGroup}
              Cooldown: '60'
              ScalingAdjustment: '-1'
          CPUAlarmHigh:
            Type: OS::Ceilometer::Alarm
            Properties:
              description: Scale-up if the average CPU > 50% for 1 minute
              meter_name: cpu_util
              statistic: avg
              period: '60'
              evaluation_periods: '1'
              threshold: '50'
              alarm_actions:
              - {"Fn::GetAtt": [WebServerScaleUpPolicy, AlarmUrl]}
              matching_metadata: {'metadata.user_metadata.groupname': {Ref: 'WebServerGroup'}}
              comparison_operator: gt
          CPUAlarmLow:
            Type: OS::Ceilometer::Alarm
            Properties:
              description: Scale-down if the average CPU < 15% for 1 minute
              meter_name: cpu_util
              statistic: avg
              period: '60'
              evaluation_periods: '1'
              threshold: '15'
              alarm_actions:
              - {"Fn::GetAtt": [WebServerScaleDownPolicy, AlarmUrl]}
              matching_metadata: {'metadata.user_metadata.groupname': {Ref: 'WebServerGroup'}}
              comparison_operator: lt
          LaunchConfig:
            Type: AWS::AutoScaling::LaunchConfiguration
            Properties:
              ImageId: {Ref: ImageId}
              InstanceType: {Ref: InstanceType}
              KeyName: {Ref: KeyName}
        Outputs:
          URL:
            Description: The URL of the website
            Value:
              Fn::Replace:
              - IpAddress: {'Fn::GetAtt': [ElasticLoadBalancer, DNSName]}
              - http://IpAddress/wordpress

when i check the heat logs and find some errors :

    2014-01-09 16:44:10.717 1351 ERROR heat.engine.resource [-] CREATE : AutoScalingGroup "WebServerGroup"
    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource Traceback (most recent call last):
    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource   File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 361, in _do_action
    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource     while not check(handle_data):
    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource   File "/usr/lib/python2.7/dist-packages/heat/engine/resources/autoscaling.py", line 353, in check_create_complete
    2014-01-09 ...
(more)
edit retag flag offensive close delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-03-27 22:13:01 -0500

jaycromer gravatar image

I ran into something similar and was able to get past it by Adding the VPCZoneIdentifierer property to the AutoscalingGroup resource and specifying a subnet id. You should be able to provide multiple subnet ids there.

edit flag offensive delete publish link more

Comments

This link provides some information on the property http://docs.openstack.org/developer/heat/template_guide/cfn.html#AWS::AutoScaling::AutoScalingGroup (CloudFormation Compatible Resource Guide)

jaycromer ( 2014-03-27 22:14:35 -0500 )edit
0

answered 2014-01-12 18:41:48 -0500

tianzhenhua gravatar image

who can tell me why?

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Follow
1 follower

Stats

Asked: 2014-01-09 19:11:52 -0500

Seen: 298 times

Last updated: Mar 27