Ask Your Question
0

multiple instance launch with network id

asked 2014-08-27 13:44:41 -0500

neal gravatar image

updated 2014-08-27 17:21:29 -0500

Hi, All I’m having a problem when launching multiple instances using OS::Heat::InstanceGroup and AWS::AutoScaling::LaunchConfiguration. But there’s no property in either of the resource to specify networks because I have two networks in neutron. Any suggestion is greatly appreciated. Thanks

Error Logs: in OpenStack DashBorad

Create_Failed: Resource CREATE failed: Error: Resource CREATE failed: BadRequest: Multiple possible networks found, use a Network ID to be more specific. (HTTP 400) (Request-ID: req-67dda05b-8344-4d5e-bdc9-f029de23dd68)

Here is part of my heat template

{
    "AWSTemplateFormatVersion" : "2010-09-09",
    "Description" : "Heat template that spins up multiple instances for Hadoop Cluster",
    "Parameters": {
        "MasterImageId" : {
            "Description" : "Image Id for Hadoop JobTracker",
            "Type" : "String",
            "Default" : "354526a7-6d76-4ad6-8c9a-9b9a849f9a90"
        },
        "NameImageId" : {
            "Description" : "Image Id for Hadoop NameNode",
            "Type" : "String",
            "Default" : "354526a7-6d76-4ad6-8c9a-9b9a849f9a90"
        },
        "NodeImageId" : {
            "Description" : "Image Id for Hadoop WorkNode",
            "Type" : "String",
            "Default" : "354526a7-6d76-4ad6-8c9a-9b9a849f9a90"
        },
        "NumOfNodes" : {
            "Description" : "Number of Nodes launched",
            "Type" : "Number",
            "Default" : "1"
        }
    },
    "Resources" : {
        "instance_master" : {
            "Type" : "OS::Nova::Server",
            "Properties" : {
                "name" : "hadoop-master",
                "image" : {"Ref" : "MasterImageId"},
                "flavor": "m1.small",
                "networks": [{
                    "network": "424277bf-f9f3-4ffa-a622-eaeb3a4206ae"
                }],
                "key_name": "ning-t5600"
            }
        },
        "instances_worker" : {
            "Type" : "OS::Heat::InstanceGroup",
            "Properties" : {
                "AvailabilityZones": { "Fn::GetAZs" : "" },
                "Size" : {"Ref": "NumOfNodes"},
                "LaunchConfigurationName":{"Ref":"NodeConfig"}
            }
        },
        "NodeConfig" : {
            "Type" : "AWS::AutoScaling::LaunchConfiguration",
            "Properties" : {
                "ImageId" : {"Ref" : "NodeImageId"},
                "InstanceType": "m1.small",
                "KeyName": "ning-t5600"
            }
        },
        "IpAssoc" : {
            "Type" : "AWS::EC2::EIPAssociation",
            "Properties": {
                "InstanceId" : {"Ref": "NodeConfig"},
                "NetworkInterfaceId" : "424277bf-f9f3-4ffa-a622-eaeb3a4206ae"
            }
        }
    }
}
edit retag flag offensive close merge delete

Comments

Users that are proficient with setting up the templates may be able to notice small issues in it, however for most of the community it would be beneficial to add in the error logs you see in the heat logs/heat cfn logs.

mpetason gravatar imagempetason ( 2014-08-27 16:17:15 -0500 )edit

2 answers

Sort by » oldest newest most voted
1

answered 2014-08-27 17:06:24 -0500

mpetason gravatar image

updated 2014-08-27 17:36:52 -0500

it looks like you are creating this in a tenant that has multiple networks. Are you launching this in the admin tenant? If so you will want to setup a tenant outside of the Admin tenant and launch this there. It's easier to set this up if there is one network available, however if there are multiples then you will need to specify it in the template.

Since you are using json I think you'll want to use something like this:

{
  "AWSTemplateFormatVersion" : "2010-09-09",
  ...
  "Resources" : {
    "TheResource": {
      "Type": "AWS::EC2::EIPAssociation",
      "Properties": {
        "AllocationId": String,
        "EIP": String,
        "InstanceId": String,
        "NetworkInterfaceId": String
      }
    }
  }
}

I believe the string would end up being the UUID for the network ID.

edit flag offensive delete link more

Comments

Hi, mpetason thanks for your suggestion. It does open another way to explore new methods(associate ips to the instances). But in my updated post, it's the same error after including EIPAssociation. Any minor issues in the template? Thanks

neal gravatar imageneal ( 2014-08-27 17:19:55 -0500 )edit

Neal, I was copying/pasting one of the examples. You don't have to include EIP, I was more so looking at the Network section:

    "NetworkInterfaceId": Sting
mpetason gravatar imagempetason ( 2014-08-27 17:32:15 -0500 )edit

I actually didn't include the EIP. The fields I included in EIPAssociation Resource is InstanceId and NeworkInterfaceId. I'm thinking that maybe the InstanceId cannot be of type LaunchConfiguration?

neal gravatar imageneal ( 2014-08-27 17:37:06 -0500 )edit

See if an error comes up again when you deploy it. Heat isn't very user friendly if you aren't used to setting up templates. I've customized a few a while back but have forgotten most of the knowledge to see configuration issues stand out.

mpetason gravatar imagempetason ( 2014-08-27 17:38:29 -0500 )edit

Thanks for your quick responses. I've been testing the template by running the template in OpenStack but it wasn't working. I guess what doesn't make sense to me is that there's no network configuration in InstanceGroup resource to support environments of multiple networks.

neal gravatar imageneal ( 2014-08-27 17:41:40 -0500 )edit
0

answered 2014-09-21 18:52:09 -0500

Steve Baker gravatar image

AWS::AutoScaling::LaunchConfiguration is designed to work with AWS::AutoScaling::AutoScalingGroup which has a property VPCZoneIdentifier that allows a subnet to be specified.

Rather than using OS::Heat::InstanceGroup, I would recommend using OS::Heat::AutoScalingGroup which lets you specify the server resource inline the resource property, which will allow you to set specific networking properties.

edit flag offensive delete link more

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

Stats

Asked: 2014-08-27 13:44:41 -0500

Seen: 984 times

Last updated: Sep 21 '14