Skip to content

Instantly share code, notes, and snippets.

@thesurlydev
Created March 8, 2013 19:54
Show Gist options
  • Save thesurlydev/5119330 to your computer and use it in GitHub Desktop.
Save thesurlydev/5119330 to your computer and use it in GitHub Desktop.
[shane@localhost heat]$ heat-cfn create wordpress3 --template-file=templates/WordPress_Single_Instance.template --parameters="InstanceType=m1.xlarge;DBUsername=${USER};DBPassword=password;KeyName=${USER}_key"
2013-03-08 14:53:01.492 3103 DEBUG heat.api.middleware.version_negotiation [-] Processing request: POST /v1/ Accept: process_request /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/api/middleware/version_negotiation.py:51
DEBUG:heat.api.middleware.version_negotiation:Processing request: POST /v1/ Accept:
2013-03-08 14:53:01.493 3103 DEBUG heat.api.middleware.version_negotiation [-] Matched versioned URI. Version: 1.0 process_request /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/api/middleware/version_negotiation.py:63
DEBUG:heat.api.middleware.version_negotiation:Matched versioned URI. Version: 1.0
2013-03-08 14:53:01.494 3103 INFO heat.api.aws.ec2token [-] Checking AWS credentials..
INFO:heat.api.aws.ec2token:Checking AWS credentials..
2013-03-08 14:53:01.496 3103 INFO heat.api.aws.ec2token [-] No AWS Signature found.
INFO:heat.api.aws.ec2token:No AWS Signature found.
2013-03-08 14:53:01.496 3103 DEBUG heat.common.auth_token [-] Authenticating user token __call__ /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/common/auth_token.py:169
DEBUG:heat.common.auth_token:Authenticating user token
2013-03-08 14:53:01.497 3103 DEBUG heat.common.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Tenant-Id,X-Tenant-Name,X-User-Id,X-User-Name,X-Roles,X-User,X-Tenant,X-Role _remove_auth_headers /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/common/auth_token.py:211
DEBUG:heat.common.auth_token:Removing headers from request environment: X-Identity-Status,X-Tenant-Id,X-Tenant-Name,X-User-Id,X-User-Name,X-Roles,X-User,X-Tenant,X-Role
2013-03-08 14:53:01.570 3103 DEBUG heat.api.cfn.v1.stacks [-] TemplateBody ... _get_template /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/api/cfn/v1/stacks.py:246
DEBUG:heat.api.cfn.v1.stacks:TemplateBody ...
2013-03-08 14:53:01.573 3103 DEBUG heat.openstack.common.rpc.amqp [-] Making synchronous call on engine.localhost.localdomain ... multicall /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/openstack/common/rpc/amqp.py:362
DEBUG:heat.openstack.common.rpc.amqp:Making synchronous call on engine.localhost.localdomain ...
2013-03-08 14:53:01.575 3103 DEBUG heat.openstack.common.rpc.amqp [-] MSG_ID is 6cd3e47d98a34427a65d40b1185b1ac4 multicall /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/openstack/common/rpc/amqp.py:365
DEBUG:heat.openstack.common.rpc.amqp:MSG_ID is 6cd3e47d98a34427a65d40b1185b1ac4
2013-03-08 14:53:01.600 3104 DEBUG heat.openstack.common.rpc.amqp [-] received {u'_context_roles': [u'KeystoneServiceAdmin', u'KeystoneAdmin', u'admin'], u'_msg_id': u'6cd3e47d98a34427a65d40b1185b1ac4', u'args': {u'stack_name': u'wordpress3', u'args': {u'timeout_mins': u'60'}, u'params': {u'DBUsername': u'shane', u'KeyName': u'shane_key', u'InstanceType': u'm1.xlarge', u'DBPassword': u'password'}, u'template': {u'Description': u'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.', u'Parameters': {u'DBUsername': {u'ConstraintDescription': u'must begin with a letter and contain only alphanumeric characters.', u'Description': u'The WordPress database admin account username', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z][a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'16', u'Type': u'String'}, u'LinuxDistribution': {u'Default': u'F17', u'Type': u'String', u'Description': u'Distribution of choice', u'AllowedValues': [u'F16', u'F17', u'U10', u'RHEL-6.1', u'RHEL-6.2', u'RHEL-6.3']}, u'DBRootPassword': {u'ConstraintDescription': u'must contain only alphanumeric characters.', u'Description': u'Root password for MySQL', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'41', u'Type': u'String'}, u'KeyName': {u'Type': u'String', u'Description': u'Name of an existing EC2 KeyPair to enable SSH access to the instances'}, u'DBName': {u'ConstraintDescription': u'must begin with a letter and contain only alphanumeric characters.', u'Description': u'The WordPress database name', u'Default': u'wordpress', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z][a-zA-Z0-9]*', u'MaxLength': u'64', u'Type': u'String'}, u'DBPassword': {u'ConstraintDescription': u'must contain only alphanumeric characters.', u'Description': u'The WordPress database admin account password', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'41', u'Type': u'String'}, u'InstanceType': {u'Default': u'm1.large', u'ConstraintDescription': u'must be a valid EC2 instance type.', u'Type': u'String', u'Description': u'WebServer EC2 instance type', u'AllowedValues': [u't1.micro', u'm1.small', u'm1.large', u'm1.xlarge', u'm2.xlarge', u'm2.2xlarge', u'm2.4xlarge', u'c1.medium', u'c1.xlarge', u'cc1.4xlarge']}}, u'AWSTemplateFormatVersion': u'2010-09-09', u'Outputs': {u'WebsiteURL': {u'Description': u'URL for Wordpress wiki', u'Value': {u'Fn::Join': [u'', [u'http://', {u'Fn::GetAtt': [u'WikiDatabase', u'PublicIp']}, u'/wordpress']]}}}, u'Resources': {u'WikiDatabase': {u'Type': u'AWS::EC2::Instance', u'Properties': {u'UserData': {u'Fn::Base64': {u'Fn::Join': [u'', [u'#!/bin/bash -v\n', u'/opt/aws/bin/cfn-init\n', u'# Setup MySQL root password and create a user\n', u"mysqladmin -u root password '", {u'Ref': u'DBRootPassword'}, u"'\n", u"cat << EOF | mysql -u root --password='", {u'Ref': u'DBRootPassword'}, u"'\n", u'CREATE DATABASE ', {u'Ref': u'DBName'}, u';\n', u'GRANT ALL PRIVILEGES ON ', {u'Ref': u'DBName'}, u'.* TO "', {u'Ref': u'DBUsername'}, u'"@"localhost"\n', u'IDENTIFIED BY "', {u'Ref': u'DBPassword'}, u'";\n', u'FLUSH PRIVILEGES;\n', u'EXIT\n', u'EOF\n', u'sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf\n', u'sed --in-place --e s/database_name_here/', {u'Ref': u'DBName'}, u'/ --e s/username_here/', {u'Ref': u'DBUsername'}, u'/ --e s/password_here/', {u'Ref': u'DBPassword'}, u'/ /usr/share/wordpress/wp-config.php\n', u'systemctl restart httpd.service\n']]}}, u'KeyName': {u'Ref': u'KeyName'}, u'InstanceType': {u'Ref': u'InstanceType'}, u'ImageId': {u'Fn::FindInMap': [u'DistroArch2AMI', {u'Ref': u'LinuxDistribution'}, {u'Fn::FindInMap': [u'AWSInstanceType2Arch', {u'Ref': u'InstanceType'}, u'Arch']}]}}, u'Metadata': {u'AWS::CloudFormation::Init': {u'config': {u'services': {u'systemd': {u'httpd': {u'ensureRunning': u'true', u'enabled': u'true'}, u'mysqld': {u'ensureRunning': u'true', u'enabled': u'true'}}}, u'packages': {u'yum': {u'httpd': [], u'wordpress': [], u'mysql-server': [], u'mysql': []}}}}}}}, u'Mappings': {u'DistroArch2AMI': {u'RHEL-6.2': {u'32': u'rhel62-i386-cfntools', u'64': u'rhel62-x86_64-cfntools'}, u'RHEL-6.3': {u'32': u'rhel63-i386-cfntools', u'64': u'rhel63-x86_64-cfntools'}, u'RHEL-6.1': {u'32': u'rhel61-i386-cfntools', u'64': u'rhel61-x86_64-cfntools'}, u'U10': {u'32': u'U10-i386-cfntools', u'64': u'U10-x86_64-cfntools'}, u'F16': {u'32': u'F16-i386-cfntools', u'64': u'F16-x86_64-cfntools'}, u'F17': {u'32': u'F17-i386-cfntools', u'64': u'F17-x86_64-cfntools'}}, u'AWSInstanceType2Arch': {u'm1.large': {u'Arch': u'64'}, u'm2.2xlarge': {u'Arch': u'64'}, u'm1.small': {u'Arch': u'32'}, u'c1.medium': {u'Arch': u'32'}, u'm1.xlarge': {u'Arch': u'64'}, u'm2.xlarge': {u'Arch': u'64'}, u't1.micro': {u'Arch': u'32'}, u'm2.4xlarge': {u'Arch': u'64'}, u'c1.xlarge': {u'Arch': u'64'}, u'cc1.4xlarge': {u'Arch': u'64'}}}}}, u'_context_password': u'verybadpass', u'_context_auth_url': u'http://127.0.0.1:5000/v2.0', u'_context_aws_auth_uri': None, u'_context_service_tenant': u'service', u'_context_service_password': u'verybadpass', u'_context_aws_creds': None, u'_context_service_user': u'heat', u'_context_tenant': u'admin', u'_context_auth_token': '<SANITIZED>', u'_context_is_admin': True, u'version': u'1.0', u'_context_tenant_id': u'90b1f0954ba641b6b8b3e41094da6fc4', u'method': u'create_stack', u'_context_username': u'admin'} _safe_log /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/openstack/common/rpc/common.py:250
2013-03-08 14:53:01.603 3104 DEBUG heat.openstack.common.rpc.amqp [-] unpacked context: {'username': u'admin', 'service_user': u'heat', 'service_tenant': u'service', 'roles': [u'KeystoneServiceAdmin', u'KeystoneAdmin', u'admin'], 'aws_auth_uri': None, 'tenant_id': u'90b1f0954ba641b6b8b3e41094da6fc4', 'auth_token': '<SANITIZED>', 'service_password': u'verybadpass', 'auth_url': u'http://127.0.0.1:5000/v2.0', 'is_admin': True, 'password': u'verybadpass', 'aws_creds': None, 'tenant': u'admin'} _safe_log /usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/openstack/common/rpc/common.py:250
2013-03-08 14:53:01.606 3104 INFO heat.engine.service [-] template is {u'Description': u'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.', u'Parameters': {u'DBUsername': {u'Type': u'String', u'Description': u'The WordPress database admin account username', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z][a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'16', u'ConstraintDescription': u'must begin with a letter and contain only alphanumeric characters.'}, u'LinuxDistribution': {u'Default': u'F17', u'Type': u'String', u'Description': u'Distribution of choice', u'AllowedValues': [u'F16', u'F17', u'U10', u'RHEL-6.1', u'RHEL-6.2', u'RHEL-6.3']}, u'InstanceType': {u'Default': u'm1.large', u'Type': u'String', u'ConstraintDescription': u'must be a valid EC2 instance type.', u'Description': u'WebServer EC2 instance type', u'AllowedValues': [u't1.micro', u'm1.small', u'm1.large', u'm1.xlarge', u'm2.xlarge', u'm2.2xlarge', u'm2.4xlarge', u'c1.medium', u'c1.xlarge', u'cc1.4xlarge']}, u'DBRootPassword': {u'Type': u'String', u'Description': u'Root password for MySQL', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'41', u'ConstraintDescription': u'must contain only alphanumeric characters.'}, u'KeyName': {u'Type': u'String', u'Description': u'Name of an existing EC2 KeyPair to enable SSH access to the instances'}, u'DBPassword': {u'Type': u'String', u'Description': u'The WordPress database admin account password', u'Default': u'admin', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z0-9]*', u'NoEcho': u'true', u'MaxLength': u'41', u'ConstraintDescription': u'must contain only alphanumeric characters.'}, u'DBName': {u'Type': u'String', u'Description': u'The WordPress database name', u'Default': u'wordpress', u'MinLength': u'1', u'AllowedPattern': u'[a-zA-Z][a-zA-Z0-9]*', u'MaxLength': u'64', u'ConstraintDescription': u'must begin with a letter and contain only alphanumeric characters.'}}, u'AWSTemplateFormatVersion': u'2010-09-09', u'Outputs': {u'WebsiteURL': {u'Description': u'URL for Wordpress wiki', u'Value': {u'Fn::Join': [u'', [u'http://', {u'Fn::GetAtt': [u'WikiDatabase', u'PublicIp']}, u'/wordpress']]}}}, u'Resources': {u'WikiDatabase': {u'Type': u'AWS::EC2::Instance', u'Properties': {u'UserData': {u'Fn::Base64': {u'Fn::Join': [u'', [u'#!/bin/bash -v\n', u'/opt/aws/bin/cfn-init\n', u'# Setup MySQL root password and create a user\n', u"mysqladmin -u root password '", {u'Ref': u'DBRootPassword'}, u"'\n", u"cat << EOF | mysql -u root --password='", {u'Ref': u'DBRootPassword'}, u"'\n", u'CREATE DATABASE ', {u'Ref': u'DBName'}, u';\n', u'GRANT ALL PRIVILEGES ON ', {u'Ref': u'DBName'}, u'.* TO "', {u'Ref': u'DBUsername'}, u'"@"localhost"\n', u'IDENTIFIED BY "', {u'Ref': u'DBPassword'}, u'";\n', u'FLUSH PRIVILEGES;\n', u'EXIT\n', u'EOF\n', u'sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf\n', u'sed --in-place --e s/database_name_here/', {u'Ref': u'DBName'}, u'/ --e s/username_here/', {u'Ref': u'DBUsername'}, u'/ --e s/password_here/', {u'Ref': u'DBPassword'}, u'/ /usr/share/wordpress/wp-config.php\n', u'systemctl restart httpd.service\n']]}}, u'KeyName': {u'Ref': u'KeyName'}, u'InstanceType': {u'Ref': u'InstanceType'}, u'ImageId': {u'Fn::FindInMap': [u'DistroArch2AMI', {u'Ref': u'LinuxDistribution'}, {u'Fn::FindInMap': [u'AWSInstanceType2Arch', {u'Ref': u'InstanceType'}, u'Arch']}]}}, u'Metadata': {u'AWS::CloudFormation::Init': {u'config': {u'services': {u'systemd': {u'httpd': {u'ensureRunning': u'true', u'enabled': u'true'}, u'mysqld': {u'ensureRunning': u'true', u'enabled': u'true'}}}, u'packages': {u'yum': {u'httpd': [], u'wordpress': [], u'mysql-server': [], u'mysql': []}}}}}}}, u'Mappings': {u'DistroArch2AMI': {u'RHEL-6.2': {u'32': u'rhel62-i386-cfntools', u'64': u'rhel62-x86_64-cfntools'}, u'RHEL-6.3': {u'32': u'rhel63-i386-cfntools', u'64': u'rhel63-x86_64-cfntools'}, u'RHEL-6.1': {u'32': u'rhel61-i386-cfntools', u'64': u'rhel61-x86_64-cfntools'}, u'U10': {u'32': u'U10-i386-cfntools', u'64': u'U10-x86_64-cfntools'}, u'F16': {u'32': u'F16-i386-cfntools', u'64': u'F16-x86_64-cfntools'}, u'F17': {u'32': u'F17-i386-cfntools', u'64': u'F17-x86_64-cfntools'}}, u'AWSInstanceType2Arch': {u'm1.large': {u'Arch': u'64'}, u'm2.2xlarge': {u'Arch': u'64'}, u'm1.small': {u'Arch': u'32'}, u'c1.medium': {u'Arch': u'32'}, u'm1.xlarge': {u'Arch': u'64'}, u'm2.xlarge': {u'Arch': u'64'}, u't1.micro': {u'Arch': u'32'}, u'm2.4xlarge': {u'Arch': u'64'}, u'c1.xlarge': {u'Arch': u'64'}, u'cc1.4xlarge': {u'Arch': u'64'}}}}
2013-03-08 14:53:01.623 3104 INFO heat.engine.resource [-] Validating Instance "WikiDatabase"
2013-03-08 14:53:01.851 3104 INFO heat.engine.resource [-] creating Instance "WikiDatabase"
<CreateStackResponse>
<CreateStackResult>
<StackId>arn:openstack:heat::90b1f0954ba641b6b8b3e41094da6fc4:stacks/wordpress3/bd78611c-a061-4a1c-8f1a-9af5f369c186</StackId>
</CreateStackResult>
</CreateStackResponse>
[shane@localhost heat]$ 2013-03-08 14:53:03.056 3104 ERROR heat.engine.resource [-] create Instance "WikiDatabase"
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource Traceback (most recent call last):
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/engine/resource.py", line 321, in create
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource while not self.check_active():
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat-2013.1.a323.g180430f-py2.7.egg/heat/engine/resources/instance.py", line 326, in check_active
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource self.name, server.status))
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource Error: nova reported unexpected instance[WikiDatabase] status[ERROR]
2013-03-08 14:53:03.056 3104 TRACE heat.engine.resource
2013-03-08 14:53:03.080 3104 WARNING heat.engine.service [-] Stack create failed, state CREATE_FAILED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment