OpenStack Orchestration on the Rapid Access Cloud
Table of Contents |
---|
Introduction
Heat, the OpenStack Orchestration Service, is an OpenStack native service giving you the ability to describe your entire cloud environment in code, outlining all the resources and parameters for your cloud, then execute that code to automate provisioning multiple instances, volumes and other OpenStack resources. The following is all that is needed to provision a single m1.small
instance with Floating IP:
Code Block |
---|
heat_template_version: 2015-04-30 description: Simple template to deploy a single compute instance resources: my_instance: type: OS::Nova::Server properties: key_name: my_key user_data_format: RAW image: Ubuntu 14.04 flavor: m1.small my_instance_floating_ip: type: OS::Nova::FloatingIP properties: pool: nova my_instance_floating_ip_association: type: OS::Nova::FloatingIPAssociation properties: floating_ip: {get_resource: my_instance_floating_ip} server_id: {get_resource: my_instance} |
Why Heat?
Heat will allow you to provision large complex cloud environments without needing to manually create each individual part, or by creating scripts that need to be updated or forked in order to automate the process across different environments. Once you have a configuration file, you can roll out the environment for development, testing, production by changing the input values. For example, a ‘simple’ web application that is load-balanced and/or built for high-availability may require the following components:
...
Each of these separate items will need specific configuration and each instance will need to be identical to its pair. Since each item needs to be configured, a template allows you to list all the attributes and then treat your infrastructure as code, execute the code and launch all the individual elements.
Heat terminology
resource: individual components across OpenStack services, defined by type (e.g. instances, volumes, Floating IP addresses and the association with an instance, security groups, security group rules, etc.)
...
HOT: Heat Orchestration Template written in yaml.
Links
OpenStack Heat Orchestration Template (HOT) documentation - http://docs.openstack.org/developer/heat/template_guide/hot_guide.html
OpenStack Heat Python Client documentation - http://docs.openstack.org/developer/python-heatclient/man/heat.html
NECTAR Heat documents - https://support.ehelp.edu.au/support/solutions/articles/6000055383-introduction-to-heat
YAML Ain't Markup Language - http://yaml.org/
Provisioning your stack...
...with heat-pythonclient
Make sure you have the heat client installed:
Code Block $ sudo apt-get install heat-pythonclient
Once you have a template in a text file (simple.yaml) you can kick off your instance with:
Code Block $ heat stack-create -f simple.yaml myStack
(If you need more help using OpenStack via the command-line, see Command-line Tools in the Advanced Guide)
...with the dashboard
You can also use the Rapid Access Cloud dashboard (https://cloud.cybera.ca) to orchestrate your environment.
...
5. Once the stack has begun to launch, you can click on its name to see its topology, an overview of the stack, as well as any error messages encountered during the launch.
Caveats
You will find many example templates on the Internet, and it is certainly recommended that you make use of them to get an idea of how you can automate your environment. There are some things you need to remember however:
...