Background
Heat is an orchestration service from Openstack. While this service can be installed on an Openstack controller along with other services, Heat can run as an independent service and can be used to provision any remote clouds. This is useful, for example if you want to deploy a cloud application based HOT or AWS CloudFormation template on an Openstack cloud.
Setting up Heat service (on Mac laptop)
Pre-requisites
- MySQL (5.5)
- RabbitMQ (or any other message queue)
- Python-mysql module
NOTE According to the documentation, it should be possible to setup Heat without having to install MySQL or RabbitMQ but I ran into a number of issues in trying to do that.
Install MySQL
Download MySQL 5.5 64 bit and install on your Mac. I used the DMG package that is available. Please note, newer versions of MySQL didn't work with Heat and required a lot of configuration to get it to work.
Once installed, you can start MySQL service from "Systems Preferences" Window.
Create Heat DB on MySQL
After installing MySQL, create a heat DB.
Install Message Queue
Download RabbitMQ and install.
Start the RabbitMQ service.
Install Python MySQL
Installing MySQL client on Mac proved quite challenging as it required some compilation of some libraries and Mac's gcc compiler didn't understand the compiler flags. Here are are steps to overcome these issues:
- Install XCode 4.1 (or latest) from App store.
- Install MySQL python client using the following command.
Installing Heat Service
- Check out the source from github.
- (Optional) Install Heat by running
sudo python setup.py install
from the heat directory
Configuring Heat
In order to run Heat services, it must be registered with Keystone. This Keystone service can run locally (on Mac) or anywhere else (a Vagrant box for example). The following steps show how:
Setting Heat.conf file
In the
etc/heat/heat.conf
file, set the properties for database, RabbitMQ and Keystone endpoints. The following example shows the minimum required configuration to start Heat services. Starting Heat
- Start Heat API service. This will start the REST API services
- Start Heat engine.
Verifying Heat installation
Now that Heat is installed, you should be able run Heat client and get stack information. First, you'll need to install the Heat client.
Next set the username, password and Keystone endpoint the Heat client will use to authenticate before running any Heat commands. For example,
NOTE The above setting will allow Heat to create resources for
admin
project as admin
user. If you want to use Heat to create resources for other tenants then you should use user credentials associated with that tenant
Running
heat stack-list
now return an empty list.
You should now be able to launch VM instances or create other resources by using a Heat template. Many sample templates are available on https://github.com/openstack/heat-templates.