39
Orchestration with Openstack Heat Why ‘Heat’? It makes the clouds rise! February 25, 2016 Hassaan Ali [email protected] 1

Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Embed Size (px)

Citation preview

Page 1: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Orchestration with Openstack HeatWhy ‘Heat’? It makes the clouds rise!

February 25, 2016

Hassaan Ali [email protected]

1

Page 2: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

What are we going to do today?

• What is Orchestration and Why we do it?

• Heat Orchestration Template

• Architecture of Heat

• Heat Workflow

• Working with Heat

• Heat Use cases

2

Page 3: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Orchestration

3

Page 4: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Orchestration (In Computing)

"Orchestration" is the "automated arrangement, coordination, and management of complex computer systems“ (Wikipedia)

4

Page 5: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat

• Heat provides a mechanism for orchestrating OpenStack resources through the use of modular templates

• Heat allows you to spin up multiple instances, logical networks, and other cloud services in an automated fashion

5

Page 6: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Openstack Logical Architecture

6

Page 7: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Basics - Template

• Templates aka HOT are written in YAML syntax

• Templates define a stack

• Stack – group of connected cloud resources (VMs, Volumes, networks etc.)

• Heat templates have the same structure & abstractions as AWS CloudFormation templates

7

Page 8: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

HOT – Basic Format

8

Page 9: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Architecture

Heat CLI tools

9

Page 10: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Architecture

Heat CLI tools

10

• Heat-api (Openstack native REST API) or heat-api-cfn(provides AWS Query API)

• Communicates with Heat Engine via AMQP and tells it what actions to perform

• This can be initiated from using Heat CLI tools or Horizon Dashboard

Page 11: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Architecture

11

• Core part – Does all theorchestration work

• Layer on which resourceintegration is implemented

• Contains abstractions to useAuto Scaling & HA

Page 12: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Orchestration Workflow

?

12

Page 13: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

How to monitor the

created stack?

13

Page 14: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Ceilometer

• Not a part of Heat – A separate Openstack component

• Provides a framework for metering and monitoring in Openstack cloud

• Meters and Monitors all resources

• Generates Alarms to create more resources

• An alarm allows Ceilometer to POST to a URL when a metric matches certain values

14

Page 15: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Ceilometer

15

Page 16: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Creating Single Instance with HOT

16

Page 17: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Works fine but we want to write portable, reusable templates that do not hardcode information about your local environment

17

Page 18: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Templates: Parameters

To create a heat stack, parameters can be specified:

18

Page 19: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Adding a script to run at Instance Launch

19

Page 20: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Environment Files

• An environment file is a YAML file with a parameters section containing values for parameters declared in your template:

• To create a heat stack in CLI using environment file:

20

Page 21: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

List User’s Stacks

21

Page 22: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Templates: Outputs

• Sometimes we want to extract information about a stack:

• These outputs can be retrieved via heat output-list and heat output-show commands:

22

Page 23: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Using Heat from Dashboard

23

Page 24: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

24

Page 25: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

25

Page 26: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Stack Deployment

26

Page 27: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Stack Deployment

27

Page 28: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Stack Deployment

28

Page 29: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

• There are number of resources associated with auto scaling:• AUTO SCALING GROUP- a group that can scale an arbitrary set of heat

resources.

• SCALING POLICY- defines an action that Heat can take on an Auto Scaling Group. Does nothing by itself; creates an endpoint for external triggers.

• CEILOMETER ALARM – generate an alarm when a defined threshold is reached and report it to the Heat Engine in order to take action

29

Page 30: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Auto Scaling Group

30

6

Page 31: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

31

Instance

Page 32: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Scaling Policy

32

This template does nothing by itself unless an alarm is triggered

Page 33: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

33

Instance

Page 34: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Ceilometer Alarm

This resource will notify the scaling policy resource. The scaling policy resource will increase the number of the resources defined in the scaling

group. 34

Page 35: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

35

Instance

Page 36: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

36

Page 37: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Heat Use Case: Auto Scaling

37

Page 38: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

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

38

Page 39: Orchestration using Heat - GitHub Pagesopenstackpakistan.github.io/web/resources/orchestration_with_open... · What are we going to do today? •What is Orchestration and Why we do

Thank you!

Now you are ready to orchestrate your application in Openstack

For questions/queries related to Heat or Orchestration in general, please shoot an email at: [email protected]

39