Jump to: navigation, search

Difference between revisions of "Heat/GettingStartedUsingDevstack"

(Confirming heat is responding)
 
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
__NOTOC__
+
 
 
== Heat and Devstack ==
 
== Heat and Devstack ==
  
Heat is fully integrated into [http://devstack.org/ DevStack]. This is a convenient way to try out or develop heat alongside the current development state of all the other [[OpenStack]] projects. Heat on [[DevStack]] works on both Ubuntu and Fedora.
+
Heat is fully integrated into [http://devstack.org/ DevStack]. This is a convenient way to try out or develop heat alongside the current development state of all the other [[OpenStack]] projects. Heat on DevStack works on both Ubuntu and Fedora.
  
These instructions assume you already have a working [[DevStack]] installation which can launch basic instances.
+
These instructions assume you already have a working DevStack installation which can launch basic instances.
  
== Configure [[DevStack]] to enable Heat ==
+
== Configure DevStack to enable Heat ==
 
+
To enable, add the following to local.conf
Adding the following line to your `localrc` file will enable the heat services
 
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 14: Line 13:
 
</nowiki></pre>
 
</nowiki></pre>
  
 
+
However it is useful to have an OS image available which Heat can launch.
It would also be useful to automatically download and register a VM image that Heat can launch.
 
  
 
<pre><nowiki>
 
<pre><nowiki>
IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F16-x86_64-cfntools.qcow2"
+
## It would also be useful to automatically download and register VM images that Heat can launch.
 +
# 64bit image (~660MB)
 +
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2"
 +
# 32bit image (~640MB)
 +
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/i386/Fedora-i386-20-20140407-sda.qcow2"
 
</nowiki></pre>
 
</nowiki></pre>
 
URLs for any of [https://github.com/heat-api/prebuilt-jeos-images/downloads these prebuilt JEOS images] can be specified.
 
  
 
That is all the configuration that is required. When you run `./stack.sh` the Heat processes will be launched in `screen` with the labels prefixed with `h-`.
 
That is all the configuration that is required. When you run `./stack.sh` the Heat processes will be launched in `screen` with the labels prefixed with `h-`.
Line 33: Line 33:
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
Check if heat service is registered with Keystone
 +
 +
<pre><nowiki>
 +
keystone service-list |grep heat
 +
</nowiki></pre>
  
 
You can confirm that Heat is running and responding with this command
 
You can confirm that Heat is running and responding with this command
  
 
<pre><nowiki>
 
<pre><nowiki>
heat list
+
heat stack-list
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 49: Line 54:
 
nova flavor-list
 
nova flavor-list
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
Heat needs to launch instances with a keypair, so we need to generate one
 
Heat needs to launch instances with a keypair, so we need to generate one
Line 57: Line 61:
 
chmod 600 heat_key.priv
 
chmod 600 heat_key.priv
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
== Launching a stack ==
 
== Launching a stack ==
Line 63: Line 66:
  
 
<pre><nowiki>
 
<pre><nowiki>
heat create teststack --template-file=/opt/stack/heat/templates/WordPress_Single_Instance.template --parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F16"
+
heat stack-create teststack -u http://git.openstack.org/cgit/openstack/heat-templates/plain/hot/F20/WordPress_Native.yaml -P key_name=heat_key -P image_id=Fedora-i386-20-20140407-sda
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 75: Line 78:
 
+--------------------------------------+-----------+--------------------+----------------------+
 
+--------------------------------------+-----------+--------------------+----------------------+
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== List stacks ===
 
=== List stacks ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
heat list
+
heat stack-list
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== List stack events ===
 
=== List stack events ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
 
heat event-list teststack
 
heat event-list teststack
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Describe the wordpress stack ===
 
=== Describe the wordpress stack ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
heat describe teststack
+
heat stack-show teststack
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 107: Line 104:
  
 
Point a web browser at the location given by the WebsiteURL Output as shown by heat stack-show teststack::
 
Point a web browser at the location given by the WebsiteURL Output as shown by heat stack-show teststack::
 
  
 
<pre><nowiki>
 
<pre><nowiki>
 
wget ${WebsiteURL}
 
wget ${WebsiteURL}
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Delete the instance when done ===
 
=== Delete the instance when done ===
  
 
<pre><nowiki>
 
<pre><nowiki>
heat delete teststack
+
heat stack-delete teststack
heat list
+
heat stack-list
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
Note: This operation will show no running stack.
 
Note: This operation will show no running stack.

Latest revision as of 03:59, 9 June 2015

Heat and Devstack

Heat is fully integrated into DevStack. This is a convenient way to try out or develop heat alongside the current development state of all the other OpenStack projects. Heat on DevStack works on both Ubuntu and Fedora.

These instructions assume you already have a working DevStack installation which can launch basic instances.

Configure DevStack to enable Heat

To enable, add the following to local.conf

ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng

However it is useful to have an OS image available which Heat can launch.

## It would also be useful to automatically download and register VM images that Heat can launch.
# 64bit image (~660MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2"
# 32bit image (~640MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/i386/Fedora-i386-20-20140407-sda.qcow2"

That is all the configuration that is required. When you run `./stack.sh` the Heat processes will be launched in `screen` with the labels prefixed with `h-`.

Confirming heat is responding

Before any heat commands can be run, the authentication environment needs to be loaded

source openrc

Check if heat service is registered with Keystone

keystone service-list |grep heat

You can confirm that Heat is running and responding with this command

heat stack-list

This should return an empty line

Preparing Nova for running stacks

Enabling Heat in devstack will replace the default Nova flavors with flavours that the Heat example templates expect. You can see what those flavors are by running

nova flavor-list

Heat needs to launch instances with a keypair, so we need to generate one

nova keypair-add heat_key > heat_key.priv
chmod 600 heat_key.priv

Launching a stack

Now lets launch a stack, assuming that DEST is left as the default /opt/stack

heat stack-create teststack -u http://git.openstack.org/cgit/openstack/heat-templates/plain/hot/F20/WordPress_Native.yaml -P key_name=heat_key -P image_id=Fedora-i386-20-20140407-sda

Which will respond

+--------------------------------------+-----------+--------------------+----------------------+
| ID                                   | Name      | Status             | Created              |
+--------------------------------------+-----------+--------------------+----------------------+
| (uuid)                               | teststack | CREATE_IN_PROGRESS | (timestamp)          |
+--------------------------------------+-----------+--------------------+----------------------+

List stacks

heat stack-list

List stack events

heat event-list teststack

Describe the wordpress stack

heat stack-show teststack

Note: After a few seconds, the stack_status should change from IN_PROGRESS to CREATE_COMPLETE.

Verify instance creation

Because the software takes some time to install from the repository, it may be a few minutes before the Wordpress instance is in a running state.

Point a web browser at the location given by the WebsiteURL Output as shown by heat stack-show teststack::

wget ${WebsiteURL}

Delete the instance when done

heat stack-delete teststack
heat stack-list

Note: This operation will show no running stack.

Troubleshooting

If you encounter issues running heat, see if the solution to the issue is documented on the Troubleshooting wiki page. If not, let us know about the problem in the #heat IRC channel on freenode.