Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

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

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.

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

  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",

"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.",

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