an introduction to openstack heat

26
Diving into Heat Mirantis, 2013 Dina Belova

Upload: mirantis

Post on 08-May-2015

18.420 views

Category:

Technology


2 download

DESCRIPTION

Miratis specialist Dina Belova gives you an introduction to OpenStack's new orchestration project, OpenStack Heat.

TRANSCRIPT

Page 1: An Introduction to OpenStack Heat

Diving intoHeat

Mirantis, 2013Dina Belova

Page 2: An Introduction to OpenStack 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

What is Heat?

Page 3: An Introduction to OpenStack Heat

● AWS CloudFormation● TOSCA:

Topology and Orchestration Specification for Cloud Applications

Heat ideas and standards

Page 4: An Introduction to OpenStack Heat

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

Page 5: An Introduction to OpenStack Heat

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

Page 6: An Introduction to OpenStack Heat

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

Page 7: An Introduction to OpenStack Heat

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)

Page 8: An Introduction to OpenStack Heat

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

Page 9: An Introduction to OpenStack Heat

Heat Basic WorkFlow

OpenStackStack

VM VMVM

Heat CLI tools

Heat

DB

Heat API

CloudWatchAPI

Heat Engine

MQ Watcher Task

Scaling Policy

Auto Scaling Group

Page 10: An Introduction to OpenStack Heat

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

Page 11: An Introduction to OpenStack Heat

Heat Engine

● Does all the orchestration work● Layer on which resource integration is

implemented● Contains abstractions to use Auto Scaling and

High Availability

Page 12: An Introduction to OpenStack Heat

Heat CloudWatch API

● Ideologically refers to AWS CloudWatch service (gets metrics from stacks)

● Will be replaced by Ceilometer● Used for Auto Scaling

Page 13: An Introduction to OpenStack Heat

Heat CLI tools

● heatclient uses Heat REST API● heat-cfn uses Heat CloudFormation compatible

API (deprecated)

Page 14: An Introduction to OpenStack Heat

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

Page 16: An Introduction to OpenStack Heat

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.

Page 17: An Introduction to OpenStack Heat

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

Page 18: An Introduction to OpenStack Heat

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

Page 19: An Introduction to OpenStack Heat

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

Page 20: An Introduction to OpenStack Heat

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

Page 21: An Introduction to OpenStack Heat

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"] }}

Page 22: An Introduction to OpenStack Heat

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" } }}

Page 23: An Introduction to OpenStack Heat

Template elements example

Resources "Resources" : { "network": { "Type": "OS::Quantum::Net", "Properties": { "name": "the_network" } },

"unnamed_network": { "Type": "OS::Quantum::Net" },}

Page 24: An Introduction to OpenStack Heat

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" }}

Page 26: An Introduction to OpenStack Heat

Thank you for the attention

www.mirantis.com

[email protected]