Diving Into Heat: Mirantis, 2013 Dina Belova

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Diving into

Heat
Dina Belova

Mirantis, 2013

What is Heat?
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

Heat ideas and standards


AWS CloudFormation
TOSCA:
Topology and
Orchestration
Specification for
Cloud
Applications

Heat basics. Stack


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


Heat CLI
tools

Heat
Heat API

Heat Engine
MQ

Watcher Task

Scaling Policy

CloudWatch
API

Auto Scaling Group

VM

VM

Stack

OpenStack

VM

DB

Heat API
heat-api (OpenStack native REST API) or heat-apicfn (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
event-show
resource-list
resource-metadata
resource-show
stack-create
stack-delete
stack-list
stack-show
stack-update
template-show
template-validate
help

List events for a stack.


Describe the event.
Show list of resources belonging to a stack.
List resource metadata.
Describe the resource.
Create the stack.
Delete the stack.
List the user's stacks.
Describe the stack.
Update the stack.
Get the template for the specified stack.
Validate a template with parameters.
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/heattemplates/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"
"m1.small"
: { "Arch"
"m1.medium" : { "Arch"
"m1.large"
: { "Arch"
"m1.xlarge" : { "Arch"
}
}

:
:
:
:
:

"32"
"64"
"64"
"64"
"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

[email protected]

You might also like