Download - An Introduction to OpenStack Heat
Diving intoHeat
Mirantis, 2013Dina Belova
● Orchestration service for OpenStack (officially supports Grizzly release)
● Uses templating mechanism● Controls complex groups of cloud resources● Huge potential and multiple use cases● More than 20 active contributors
What is Heat?
● AWS CloudFormation● TOSCA:
Topology and Orchestration Specification for Cloud Applications
Heat ideas and standards
Stack - group of connected cloud resources (VM, volumes, networks, etc.)
● Autoscaling
● HA mechanism for the different levels (services running inside an instance, individual instances, stacks)
● Nested stacks
Heat basics. Stack
Heat basics. Template
● Stacks are created from templates● Heat templates have the same structure and
abstractions as AWS CloudFormation templates● Resource mapping in the next OpenStack release● Templates are well integrated with Chef and
Puppet
Heat Roadmap (Havanna)
● Parallel source creation● Improve networking / Quantum support● Rollings updates● Support for extended template language● Add AutoScaling API actions● Move to Ceilometer for
metrics / monitoring / alarms
Heat Roadmap (Havanna)
● More improvements for stacks updating● Improved security● Native for OpenStack resource types (resource
mapping)● Add suspend / resume stack actions● Configurable LoadBalancer (LBaaS)
Already in Heat
● Nested stacks● High Availability (HA) for different resource levels● Associate users with templates using Keystone● Get boto (Python programming language
interface to Amazon Web Services) working with Heat
● API rework to align AWS specification
Heat Basic WorkFlow
OpenStackStack
VM VMVM
Heat CLI tools
Heat
DB
Heat API
CloudWatchAPI
Heat Engine
MQ Watcher Task
Scaling Policy
Auto Scaling Group
Heat API
● heat-api (OpenStack native REST API) or heat-api-cfn (provides AWS Query API)
● Communicates with Heat Engine and tells it what actions to do
Heat Engine
● Does all the orchestration work● Layer on which resource integration is
implemented● Contains abstractions to use Auto Scaling and
High Availability
Heat CloudWatch API
● Ideologically refers to AWS CloudWatch service (gets metrics from stacks)
● Will be replaced by Ceilometer● Used for Auto Scaling
Heat CLI tools
● heatclient uses Heat REST API● heat-cfn uses Heat CloudFormation compatible
API (deprecated)
Heat Auto Scaling Principles
● Agents are installed to the VMs. They send VM telemetry to the monitoring component periodically
● Monitoring component (Heat CloudWatch) is responsible for the communication between VMs and Heat
● Core functionality (implemented in Heat Engine) provides the scaling itself
Installation
● Heat + DevStack● Heat + Ubuntu ● Heat + Fedora
CLI (Heat Client)
event-list List events for a stack.event-show Describe the event.resource-list Show list of resources belonging to a stack.resource-metadata List resource metadata.resource-show Describe the resource.stack-create Create the stack.stack-delete Delete the stack.stack-list List the user's stacks.stack-show Describe the stack.stack-update Update the stack.template-show Get the template for the specified stack.template-validate Validate a template with parameters.help Display help about this program or one of its subcommands.
Try Heat + DevStack
Launch a stack:heat stack-create teststack
-u <template_to_use> \-P "InstanceType=m1.large; \
DBUsername=wp; \ DBPassword=verybadpassword; \ KeyName=heat_key; \ LinuxDistribution=F17"
Example of template to use address:https://raw.github.com/openstack/heat-templates/master/cfn/WordPress_Single_Instance.template
Get stack's list
heat stack-list
If everything is nice after stack creation+--------------------------------------+------------+-----------------+----------------------+| id | stack_name | stack_status | creation_time |+--------------------------------------+------------+-----------------+----------------------+| 70296f8e-f301-465f-8b42-1aa3f95c42f6 | teststack | CREATE_COMPLETE | 2013-05-29T07:39:57Z |+--------------------------------------+------------+-----------------+----------------------+
If something goes wrong+--------------------------------------+------------+---------------+----------------------+| id | stack_name | stack_status | creation_time |+--------------------------------------+------------+---------------+----------------------+| 70296f8e-f301-465f-8b42-1aa3f95c42f6 | teststack | CREATE_FAILED | 2013-05-29T07:39:57Z |+--------------------------------------+------------+---------------+----------------------+
Delete stack
heat stack-delete 70296f8e-f301-465f-8b42-1aa3f95c42f6
+--------------------------------------+------------+--------------------+----------------------+| id | stack_name | stack_status | creation_time |+--------------------------------------+------------+--------------------+----------------------+| 70296f8e-f301-465f-8b42-1aa3f95c42f6 | teststack | DELETE_IN_PROGRESS | 2013-05-29T07:38:11Z |+--------------------------------------+------------+--------------------+----------------------+
Template structure
● Description● Parameters● Mappings● Resources● Outputs
{ "AWSTemplateFormatVersion" : "version date",
"Description" : "Valid JSON strings up to 4K",
"Parameters" : { set of parameters }, "Mappings" : { set of mappings }, "Resources" : { set of resources },
"Outputs" : { set of outputs }}
Template elements example
Description"Description" : "Template to test something important"
Parameters"Parameters": {
"InstanceType" : {"Description" : "Test instance type",
"Type" : "String", "Default" : "m1.small", "AllowedValues" : ["m1.small", "m1.medium"] }}
Template elements example
Mappings "Mappings" : {
"AWSInstanceType2Arch" : {"m1.tiny" : { "Arch" : "32" },
"m1.small" : { "Arch" : "64" }, "m1.medium" : { "Arch" : "64" }, "m1.large" : { "Arch" : "64" }, "m1.xlarge" : { "Arch" : "64" } }}
Template elements example
Resources "Resources" : { "network": { "Type": "OS::Quantum::Net", "Properties": { "name": "the_network" } },
"unnamed_network": { "Type": "OS::Quantum::Net" },}
Template elements example
Outputs"Outputs" : { "the_network_status" : { "Value" : { "Fn::GetAtt" : [ "network", "status" ]}, "Description" : "Status of network" },
"port_device_owner" : { "Value" : { "Fn::GetAtt" : [ "port", "device_owner"]}, "Description" : "Device owner of the port" }}
Useful links
● http://docs.openstack.org/developer/heat/ ● https://wiki.openstack.org/wiki/Heat ● https://github.com/openstack/heat● https://github.com/openstack/heat-templates
Thank you for the attention
www.mirantis.com