Ask Your Question
0

Unable to create instance using wordpress template:openstack heat

asked 2014-02-20 14:11:31 -0500

malleshicn gravatar image

Hello team , I am unable to create a stack using wordpress template, getting below error

2014-02-20 10:42:45.519 905 TRACE heat.engine.resource resp, body = self.request(url, method, **kwargs) 2014-02-20 10:42:45.519 905 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 189, in request 2014-02-20 10:42:45.519 905 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method) 2014-02-20 10:42:45.519 905 TRACE heat.engine.resource BadRequest: Multiple possible networks found, use a Network ID to be more specific. (HTTP 400) (Request-ID: req-73955d36-fd14-463f-a659-e0dd80c01b8b) 2014-02-20 10:42:45.519 905 TRACE heat.engine.resource 2014-02-20 10:42:45.544 905 WARNING heat.engine.service [-] Stack create failed, status FAILED

Do I need to add my network ID and subnet ID details in the template...? I am using below template

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

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

"DBName": {
  "Default": "wordpress",
  "Description" : "The WordPress database name",
  "Type": "String",
  "MinLength": "1",
  "MaxLength": "64",
  "AllowedPattern" : "[a-zA-Z][a-zA-Z0-9]*",
  "ConstraintDescription" : "must begin with a letter and contain only alphanumeric characters."
},

"DBUsername": {
  "Default": "admin",
  "NoEcho": "true",
  "Description" : "The WordPress database admin account username",
  "Type": "String",
  "MinLength": "1",
  "MaxLength": "16",
  "AllowedPattern" : "[a-zA-Z][a-zA-Z0-9]*",
  "ConstraintDescription" : "must begin with a letter and contain only alphanumeric characters."
},

"DBPassword": {
  "Default": "admin",
  "NoEcho": "true",
  "Description" : "The WordPress database admin account password",
  "Type": "String",
  "MinLength": "1",
  "MaxLength": "41",
  "AllowedPattern" : "[a-zA-Z0-9]*",
  "ConstraintDescription" : "must contain only alphanumeric characters."
},

"DBRootPassword": {
  "Default": "admin",
  "NoEcho": "true",
  "Description" : "Root password for MySQL",
  "Type": "String",
  "MinLength": "1",
  "MaxLength": "41",
  "AllowedPattern" : "[a-zA-Z0-9]*",
  "ConstraintDescription" : "must contain only alphanumeric characters."
},
"LinuxDistribution": {
  "Default": "F17",
  "Description" : "Distribution of choice",
  "Type": "String",
  "AllowedValues" : [ "cirros", "F17", "U10", "RHEL-6.1", "RHEL-6.2", "RHEL-6.3" ]
}

},

"Mappings" : { "AWSInstanceType2Arch" : { "m1.tiny" : { "Arch" : "32" }, "m1.small" : { "Arch" : "64" }, "m1.medium" : { "Arch" : "64" }, "m1.large" : { "Arch" : "64" }, "m1.xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { "cirros" : { "32" : "cirros-i386-cfntools", "64" : "cirros-x86_64-cfntools" }, "F17" : { "32" : "F17-i386-cfntools", "64" : "F17-x86_64-cfntools" }, "U10" : { "32" : "U10-i386-cfntools", "64" : "U10-x86_64-cfntools" }, "RHEL-6.1" : { "32" : "rhel61-i386-cfntools", "64" : "rhel61-x86_64-cfntools" }, "RHEL-6.2" : { "32" : "rhel62-i386-cfntools", "64" : "rhel62-x86_64-cfntools" }, "RHEL-6.3" : { "32" : "rhel63-i386-cfntools", "64" : "rhel63-x86_64-cfntools" } } },

"Resources" : { "WikiDatabase": { "Type": "AWS::EC2::Instance", "Metadata" : { "AWS::CloudFormation::Init" : { "config" : { "packages" : { "yum" : { "mysql" : [], "mysql-server" : [], "httpd" : [], "wordpress" : [] } }, "services" : { "systemd" : { "mysqld" : { "enabled" : "true", "ensureRunning" : "true" }, "httpd" : { "enabled" : "true", "ensureRunning" : "true" } } } } } }, "Properties": { "ImageId" : { "Fn::FindInMap" : [ "DistroArch2AMI", { "Ref" : "LinuxDistribution" }, { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] }, "InstanceType" : { "Ref" : "InstanceType" }, "KeyName" : { "Ref" : "KeyName" }, "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [ "#!/bin/bash -v\n", "/opt/aws/bin/cfn-init\n", "# Setup MySQL root password and create a user\n", "mysqladmin -u root password '", { "Ref" : "DBRootPassword" }, "'\n", "cat << EOF | mysql -u root --password='", { "Ref ... (more)

edit retag flag offensive close merge delete

6 answers

Sort by ยป oldest newest most voted
0

answered 2014-02-25 11:24:54 -0500

malleshicn gravatar image

Hi Zane,

I found that in my fedora (F17) image heat-cfn-tools package is not there.

I tried to create stack with a floating IP associated.

https://github.com/abckey/heattemplates/raw/master/WordPress_Single_Instance_With_EIP.template (https://github.com/abckey/heattemplat...)

but its showed that

2014-02-25 08:28:54.812 905 TRACE heat.engine.resource NotFound: FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-27fbeae1-2e93-4cd9-a093-18365e394710) 2014-02-25 08:28:54.812 905 TRACE heat.engine.resource 2014-02-25 08:28:54.864 905 WARNING heat.engine.service [-] Stack create failed, status FAILED

do I need to add Floating IP pool to my template?

edit flag offensive delete link more
0

answered 2014-02-24 18:47:07 -0500

zaneb gravatar image

Do you have the heat-cfn-tools package installed in the image? The first line in the UserData script, "/opt/aws/bin/cfn-init\n", is the one that processes the "AWS::CloudFormation::Init" section of the Metadata and installs the listed packages.

If you don't have it installed, you'll either need to build an image that includes it or "yum install" it before calling it in the UserData script.

edit flag offensive delete link more
0

answered 2014-02-24 14:32:10 -0500

malleshicn gravatar image

Hi Zane,

Thanks for the update. Now I am able to launch the instance ..but I am unable to launch wordpress.

when I checked it i found that mysql, httpd,mysql-server & wordpress was not installed. I am installing it manually now.

but my question is why these packages not installed via script mentioned in template through yum )...?

below is the error message: /bin/systemctl status httpd.service

Loaded: error (Reason:No such file or directory_

Active: Inactive (dead)

Thanks again for your wonderful assistance and help to fixing the problem ...

edit flag offensive delete link more
0

answered 2014-02-21 16:59:00 -0500

zaneb gravatar image

The answer on ask.openstack is regrettably not as clear as it could be, but basically you are missing step 2 - now that you have the data (via the parameter), you have to use it:

... "Resources" : { "WikiDatabase": { "Type": "AWS::EC2::Instance", ... "Properties": { ... "SubnetId": {"Ref": "SubnetId"}, ... }, ... } ...

edit flag offensive delete link more
0

answered 2014-02-21 06:47:14 -0500

malleshicn gravatar image

Hi Zane,

I have added below lines to my template

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

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

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

and in aws-environ.yaml

parameters: InstanceType: m1.medium KeyName: heat_key PrivateNetworkId: ad5a1e6c-24b7-4190-b4e7-6e4f19b046ce PublicNetworkId: fbfc3fa8-473b-40fa-89e8-8c7a1acb0d0b SubnetId: 69b3ddd9-b092-4361-b541-4f171c736a9d

but still my log messages showing

9, in request 2014-02-21 03:55:59.406 905 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method) 2014-02-21 03:55:59.406 905 TRACE heat.engine.resource BadRequest: Multiple possible networks found, use a Network ID to be more specific. (HTTP 400) (Request-ID: req-3be9dcde-d27b-4d1b-a066-7d622aba2ad0) 2014-02-21 03:55:59.406 905 TRACE heat.engine.resource 2014-02-21 03:55:59.431 905 WARNING heat.engine.service [-] Stack create failed, status FAILED

below is mynetwork-details:

root@network-node:/home/oss# neutron net-list +--------------------------------------+--------------+------------------------------------------------------+ | id | name | subnets | +--------------------------------------+--------------+------------------------------------------------------+ | ad5a1e6c-24b7-4190-b4e7-6e4f19b046ce | my_net_proj | 69b3ddd9-b092-4361-b541-4f171c736a9d 50.50.x.x/24 | | fbfc3fa8-473b-40fa-89e8-8c7a1acb0d0b | my_ext_net | 93055862-88ea-43e8-bffb-7c209cfa9399 x.x.x.x/24 | +--------------------------------------+--------------+------------------------------------------------------+ root@network-node:/home/oss# neutron subnet-list +--------------------------------------+------+-----------------+------------------------------------------------------+ | id | name | cidr | allocation_pools | +--------------------------------------+------+-----------------+------------------------------------------------------+ | 69b3ddd9-b092-4361-b541-4f171c736a9d | | 50.50.x.x/24 | {"start": "50.50.x.x", "end": "50.50.x.x"} | | 93055862-88ea-43e8-bffb-7c209cfa9399 | | x.x.x.0/24 | {"start": "x.x.x.1", "end": "x.x.x.4"} | +--------------------------------------+------+-----------------+------------------------------------------------------+ root@network-node:/home/oss#

edit flag offensive delete link more
0

answered 2014-02-20 15:11:40 -0500

zaneb gravatar image

See https://ask.openstack.org/en/question/10085/multiple-possible-networks-found-use-a-network-id-to-be-more-specific/ (https://ask.openstack.org/en/question...)

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

1 follower

Stats

Asked: 2014-02-20 14:11:31 -0500

Seen: 2,582 times

Last updated: Feb 25 '14