[Openstack] AutoScaling fails on multiple networks?

Tianzhenhua tianzhenhua at huawei.com
Mon Jan 13 03:05:55 UTC 2014


Hi all:

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 16:44:10.717 1351 TRACE heat.engine.resource     done = super(AutoScalingGroup, self).check_create_complete(task)

    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 150, in check_create_complete

    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource     done = super(InstanceGroup, self).check_create_complete(task)

    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource   File "/usr/lib/python2.7/dist-packages/heat/engine/stack_resource.py", line 116, in check_create_complete

    2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource     raise exception.Error(self._nested.status_reason)

    **2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource Error: Resource create failed: BadRequest: Multiple possible networks found, use a Network ID to be more specific. (HTTP 400) (Request-ID: req-ac0289f2-e6ed-401b-836a-acdb176f08d9)**

2014-01-09 16:44:10.717 1351 TRACE heat.engine.resource


Could someone tell me why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140113/37d3bfff/attachment.html>


More information about the Openstack mailing list