Jump to: navigation, search

Difference between revisions of "Heat/ApplicationDeployment"

(Created page with "== Pre-requisites == * Images with cloud-init and heat-cfntools packages installed * Metadata server up and running == Walk-through in a stack's lifetime == * The user calls ...")
 
Line 1: Line 1:
 
== Pre-requisites ==
 
== Pre-requisites ==
* Images with cloud-init and heat-cfntools packages installed
+
* Images with [https://help.ubuntu.com/community/CloudInit cloud-init] and [https://github.com/openstack/heat-cfntools heat-cfntools] packages installed. It is easier to use the [http://fedorapeople.org/groups/heat/prebuilt-jeos-images/ prebuild images] from the Heat team.
 
* Metadata server up and running
 
* Metadata server up and running
  
Line 14: Line 14:
 
:* Runs the user's script (located at /var/lib/cloud/data/cfn-userdata), it can be any kind of script (Bash, Python, etc.) but at some point this script should call cfn-init.  
 
:* Runs the user's script (located at /var/lib/cloud/data/cfn-userdata), it can be any kind of script (Bash, Python, etc.) but at some point this script should call cfn-init.  
 
::* cfn-init loads /var/lib/cloud/data/cfn-init-data (a copy of the Metadata->AWS::CloudFormation::Init->Config attribute from the AWS template) and can install packages, setup users & groups, create files, etc.
 
::* cfn-init loads /var/lib/cloud/data/cfn-init-data (a copy of the Metadata->AWS::CloudFormation::Init->Config attribute from the AWS template) and can install packages, setup users & groups, create files, etc.
 +
 +
Note that heat-cfntools leverage the [https://github.com/boto/boto boto] library and that the boto configuration is stored at /var/lib/heat-cfntools/cfn-boto-cfg on the instance.
  
 
== Troubleshooting ==
 
== Troubleshooting ==

Revision as of 07:40, 7 May 2013

Pre-requisites

Walk-through in a stack's lifetime

  • The user calls the Heat API to create a stack ("heat stack-create ... myStack")
  • Heat engine generates a mime multipart data blob that will be consumed by cloud-init
  • Heat engine asks nova to create an instance with the cloud-init data
  • Nova selects a compute node to run the instance and provisions the metadata server with the cloud-init data
  • When the instance boots up, it runs the cloud-init script:
  • Download the data from the metadata server
  • Splits the multiple parts into the /var/lib/cloud/ directory
  • Run the different cloud-init parts (resize the root filesystem, set the hostname, install the user's SSH key, etc.)
  • Runs the user's script (located at /var/lib/cloud/data/cfn-userdata), it can be any kind of script (Bash, Python, etc.) but at some point this script should call cfn-init.
  • cfn-init loads /var/lib/cloud/data/cfn-init-data (a copy of the Metadata->AWS::CloudFormation::Init->Config attribute from the AWS template) and can install packages, setup users & groups, create files, etc.

Note that heat-cfntools leverage the boto library and that the boto configuration is stored at /var/lib/heat-cfntools/cfn-boto-cfg on the instance.

Troubleshooting

If you can logged into the instance, look at the following files:

  • var/log/cloud-init.log => cloud-init logs
  • /var/log/part-handler.log => logs of the Heat-specific script managing data with content-type=text/x-cfninitdata
  • /var/log/heat-provision.log => logs of the user's script including cfn-init logs

You can also query the metadata server for the user's data generated by Heat:

curl http://169.254.169.254/2009-04-04/user-data

Resources