Ask Your Question
1

Multiple possible networks found, use a Network ID to be more specific

asked 2014-01-07 00:39:52 -0500

anonymous user

Anonymous

updated 2014-01-17 16:55:58 -0500

smaffulli gravatar image

I 'm testing openstack auto scaling function,but i was met a problem,when we upload template to create a stack, it failed! So i check heat log, the error log is :Multiple possible networks found, use a Network ID to be more specific. could anybody tell me how to solve it?

template as bellow:

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
  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
Resources:

  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
edit retag flag offensive close merge delete

Comments

Thanks a lot. But what if I used OS::Heat::InstanceGroup, is there a corresponding property to specify the network?

neal gravatar imageneal ( 2014-08-27 14:01:32 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
2

answered 2014-01-07 02:26:57 -0500

unmesh-gurjar gravatar image

The error means that there are multiple networks available and you need to specify the network-id which you want your instance to be on. On nova CLI, it is specified as '--nic net-id=<network-id>' where network-id is the ID returned by 'nova network list' command. AFAIU, add this parameter to your template and give it a try!</network-id>

edit flag offensive delete link more

Comments

1

Thinks a lot ,but i'm a new developer of openstack, when i check the template about autoscaling, i can not find any parameters to set network id, could you gave me some example ?

tianzhenhua gravatar imagetianzhenhua ( 2014-01-07 02:40:34 -0500 )edit

I have the same problem too. I can not find any parameters to set network id in template , is there is any example ?

RiscYu gravatar imageRiscYu ( 2014-03-12 04:49:49 -0500 )edit
1

answered 2014-03-27 09:02:33 -0500

zaneb gravatar image

This happens when you are using Neutron and have multiple Networks defined (if only one Network exists, the server can be attached to it by default, otherwise it is ambiguous). The solution is to specify a specific Network to attach to. The way to do this depends on the resource type.

For AWS::AutoScaling::AutoScalingGroup resources, add the VPCZoneIdentifier property to the scaling group (not launch configuration) resource, with the value being the UUID of a Neutron Subnet.

For AWS::EC2::Instance resources, the easiest way is to add the property SubnetId to the resource, with the value being the UUID of a Neutron Subnet.

You can pass the Subnet UUID in as a parameter to the template, either through the environment or on the command line, or reference a Subnet created in the template using the OS::Neutron::Subnet resource (note that this requires a Network UUID as a parameter, and the same applies - you can pass it in or create it in the template with an OS::Neutron::Network resource).

If you want to keep your template compatible with CloudFormation, the AWS::EC2::VPC and AWS::EC2::Subnet resources in Heat also return the UUID of a Neutron Network and Subnet, respectively, when they are referenced in a template.

For OS::Nova::Server resources, the syntax is a little more complicated (and powerful), but it looks like this:

resources:
  my_server:
    type: OS::Nova::Server
    properties:
        networks:
          - network: <Network name or UUID>

Just replace <Network name or UUID> with the Network name or UUID. Again, you can pass it in as a parameter, or reference an OS::Neutron::Network resource in the template.

edit flag offensive delete link more

Comments

Hello Zane,

I have observerd one more thing ... using heat template I am able launch a stack but Autoscaling not happening .. I found below error in Ceilometer log

==> ceilometer-collector.log <== 2014-03-25 05:40:56.308 1047 ERROR stevedore.extension [-] error calling 'port': 'tenant_id' 2014-03-25 05:40:56.308 1047 ERROR stevedore.extension [-] 'tenant_id' 2014-03-25 05:40:56.308 1047 TRACE stevedore.extension Traceback (most recent call last): 2014-03-25 05:40:56.308 1047 TRACE stevedore.extension File "/usr/lib/python2.7/dist-packages/stevedore/extension.py", line 145, in _invoke_one_plugin 2014-03-25 05:40:56.308 1047 TRACE stevedore.extension response_callback

please refer link :https://bugs.launchpad.net/ceilometer/+bug/1276761

is this bug preventing me to do from autoscaling ..? I am trying on ubuntu 12.04, havana.. your help is apprceiated .. thanks

Malleshi gravatar imageMalleshi ( 2014-03-28 03:21:24 -0500 )edit
0

answered 2014-02-17 21:31:45 -0500

imtiaz.chowdhury gravatar image

updated 2014-02-17 21:37:12 -0500

As the message indicates, you need to specify a network ID. Unfortunately, from the Heat documentation it is not obvious how to specify network ID in the CFN template. After looking at the Heat source code and some trial and errors, I was able to figure it out. Here's what you have to do:

  1. Add an "SubnetID" section in the template (see example below).

  2. Specify the subnetId as instance properties. You can get the subnetId either from Horizon dashboard or using neutron net-list command

My Heat template (only showing partial file):

{
  "AWSTemplateFormatVersion" : "2010-09-09",

  "Description" : "AWS CloudFormation Sample Template WordPress_Single_Instance: WordPress is web software you can use to create a beautiful website or blog. This template installs a single-instance WordPress deployment using a local MySQL database to store the data.",

      "Parameters" : {

        "KeyName" : {
          "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
          "Type" : "String"
        },
        "SubnetId" : {
          "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
          "Type" : "String"
        },

And Properties file, named aws-environ.yaml:

parameters:
  InstanceType: m1.medium 
  KeyName: imtiaz-key
  SubnetId: 06edc29e-0103-469a-ad34-08c6e7994016

To launch an instance, use:

heat stack-create -f /etc/heat/templates/Wordpress_Single_Instance.template -e /etc/heat/templates/aws-environ.yaml my-stack

edit flag offensive delete link more

Comments

Hi, I add a parameter subnetid just as your sample , but I can not set the id to AWS::AutoScaling::LaunchConfiguration resource. Can you give a full template file content ?

RiscYu gravatar imageRiscYu ( 2014-03-12 04:52:01 -0500 )edit

SubnetId: {get_attr: LaunchConfiguration}

Jeffrey Guan gravatar imageJeffrey Guan ( 2016-01-21 07:48:48 -0500 )edit

Your Answer

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

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

4 followers

Stats

Asked: 2014-01-07 00:39:52 -0500

Seen: 14,415 times

Last updated: Mar 27 '14