heat/doc/source/getting_started/on_devstack.rst
huangtianhua 77a4a6d623 Improve guidelines of using devstack of heat
This patch changes:
1. Using `[[local|localrc]]` section of local.conf
instead of localrc file.
2. Add service aodh as enable plugin if using ceilometer
alarm.

Change-Id: I6098a978e57292dc913ed916b79cd372147b6dbe
2016-03-28 01:34:10 +00:00

3.4 KiB

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

Heat is configured by default on devstack for Icehouse and Juno releases. Newer versions of OpenStack require enabling heat services in devstack local.conf.

Add the following to local section of `local.conf`:

[[local|localrc]]

#Enable heat services
enable_service h-eng h-api h-api-cfn h-api-cw

It would also be useful to automatically download and register a VM image that heat can launch. To do that add the following to local section of `local.conf`:

IMAGE_URL_SITE="http://download.fedoraproject.org"
IMAGE_URL_PATH="/pub/fedora/linux/releases/21/Cloud/Images/x86_64/"
IMAGE_URL_FILE="Fedora-Cloud-Base-20141203-21.x86_64.qcow2"
IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE

URLs for any cloud image may be specified, but fedora images from F20 contain the heat-cfntools package which is required for some heat functionality.

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

Configure DevStack to enable ceilometer and aodh (if using alarms)

To use ceilometer alarms you need to enable ceilometer and aodh in devstack. Adding the following lines to local section of local.conf will enable the services:

CEILOMETER_BACKEND=mongodb
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer
enable_plugin aodh https://git.openstack.org/openstack/aodh

Configure DevStack to enable OSprofiler

Adding the following line to local section of local.conf will add the profiler notifier to your ceilometer:

CEILOMETER_NOTIFICATION_TOPICS=notifications,profiler

Enable the profiler in /etc/heat/heat.conf:

$ echo -e "[profiler]\nprofiler_enabled = True\n"\
      "trace_sqlalchemy = True\n"\
      >> /etc/heat/heat.conf

Change the default hmac_key in /etc/heat/api-paste.ini:

$ sed -i "s/hmac_keys =.*/hmac_keys = SECRET_KEY/" /etc/heat/api-paste.ini

Run any command with --profile SECRET_KEY:

$ heat --profile SECRET_KEY stack-list
# it will print <Trace ID>

Get pretty HTML with traces:

$ osprofiler trace show --html <Profile ID>

Note that osprofiler should be run with the admin user name & tenant.

Create a stack

Now that you have a working heat environment you can go to create-a-stack.