450 likes | 802 Views
OpenStack Heat 101. Overview, Capabilities, Use Case and Demo Presented to Atlanta OpenStack Meetup March 2014. Introductions. Agenda. Jason Grimm Open Cloud Solution Architect jason.grimm@rackspace.com Mike Camp Open Cloud Account Executive m ike.camp@rackspace.com Tim Langan
E N D
OpenStack Heat 101 Overview, Capabilities, Use Case and Demo Presented to Atlanta OpenStack Meetup March 2014
Introductions Agenda Jason Grimm Open Cloud Solution Architect jason.grimm@rackspace.com Mike Camp Open Cloud Account Executive mike.camp@rackspace.com Tim Langan Enterprise Account Executive Tim.langan@rackspace.com Illyse Scheaffer Enterprise Solutions Engineer Illyse.scheaffer@rackspace.com About the Presentation About the Speaker Rackspace Overview OpenStack Overview Heat Background Heat Architecture Heat Operations Heat Demo Heat Group Exercise 2 2
I’d rather “discuss” than “present”, don’t be shy, please interrupt • I work for Rackspace, but this is not a sales pitch • I’m presenting some of this content at the summit; your candid feedback is greatly appreciated • Excuse my PowerPoint (lack of) skills, slides either look like: • Marketing intern with too much time on their hands • Notepad copy / paste • Lots of slides but will go through them quickly to focus on demo and hands-on portion, slow me down if I go to fast • All materials are available at http://jtg.grimmtheory.com/summit 4 About the Presentation
About the Speaker Grant Park East Cobb Georgia Native Boston Key West Canton • Lots of hats… • Husband • Father • Veteran • Farmer • Racker • Architect • Lots of hobbies… • Music • Movies • Politics • Gun Collecting • Comedy • Reading Startup Co-Founder 2000-2004 Freelance Consulting 1996-2000 Mirantis Puppet / Fuel 2013 US Naval Intelligence 1992-1996 Dell Ruby / Crowbar 2004-2013 Rackspace Chef / RPC 2013-2014
About Rackspace 6,000+ RACKERS To be recognized as one of the world’s greatest service companies 210,000+ CUSTOMERS110,000+ SERVERS GLOBAL FOOTPRINTCUSTOMERS IN 120+ COUNTRIES 10 WORLDWIDE DATA CENTERS PORTFOLIOOF HOSTED SOLUTIONSDedicated - Cloud - Hybrid OPENSTACK FOUNDERLARGEST OPENSTACK CLOUD2nd Largest Public Cloud
OpenStack / Rackspace History John Dickinson Cloud Files (Swift) Swift PTL SwiftStack Co-Founder Chris Kemp Nebula (Nova) Nebula Founder PUBLIC CLOUD OpenStack Mission: “To enable any organization, regardless of size, to create and offer cloud computing services running on standardized hardware.” CLOUD STORAGE HYBRID CLOUD CLOUD FILES PRIVATE CLOUD
Rackspace Portfolio: PUBLIC CLOUD PRIVATE CLOUD DEDICATED HOSTING • Servers, storage, networking and platform services • Instantly available • Priced per hour • Custom private cloud • Powered by OpenStack • Hosted at your data center, partner data centeror at Rackspace • Bare metal servers • Dedicated VMware • Hosted Services: Exchange, SharePoint, mailgun, IIS, Apache, etc. MUTLI-TENANT & GENERALIZED SINGLE TENANT & SPECIALIZED
The OpenStack Project Ecosystem (Folsom > Grizzly) A collection of OpenSource projects / services, not monolithic
* Pre-July 2010 is predicated by Rackspace Cloud Files project (Swift), NASA Nebula project (Nova) OpenStack Ecosystem / History
OpenStack Project Lifecycle Open Discussion – request assistance from OpenStack contributors to add lifecycle detail Ironic project as an example: October 2013 Hong Kong Havana / Icehouse Summit April 2013 Portland Grizzly / Havana Summit September 2012 San Diego Folsom / Grizzly Summit April 2012 San Francisco Essex / Folsom Summit May 2014 Atlanta Icehouse / Juno Summit Experimental “bare metal” driver for Nova Became its own project, Independent Became a recognized “related” project Became a recognized “incubated” project Slated to become recognized as a “core” project.
Heat Described “The mission of the OpenStack Orchestration program is to create a human- and machine-accessible service for managing the entire lifecycle of infrastructure and applications within OpenStack clouds.” “Heat is the main project in the OpenStack Orchestration program. It implements an orchestration engine to launch multiple composite cloud applications based on templates in the form of text files that can be treated like code.” “Heat provides a template based orchestration for describing a cloud application by executing appropriate OpenStack API calls to generate running cloud applications.“ “Why ‘Heat’? It makes the clouds rise!” * You have to appreciate the project names – Cinder “block” storage, Ceilometer measures the distance from the earth to the clouds
Heat Explained – Overview “Orchestration” is a great industry buzz word but what does it mean? OpenStack resource abstraction and orchestration: VM Instances Networks Routers … • Orchestration – “The automated arrangement, coordination, and management of complex computer systems, middleware, and services.” • RESTfulAPI • Integration w/ other services • Programmatic • Agnostic • Repeatable • Consistent • Abstracted user experience • Worlflow • Governance / AAA • Error Checking • Error Correction • Error Recovery “Typically” Virtual (See Ironic Project) Infrastructure resource abstraction and orchestration: Compute Power Switches Block Storage … “Typically” Physical
Heat Explained – IaaS vs. PaaS Another way to look at where the Heat service fits and what it provides DBaaS VPNaaS MaaS DRUPALaaS Jason’s Mac Core Projects
Heat Main Components heat The heat tool is a CLI which communicates with the heat-api to execute AWS CloudFormation APIs. End developers could also use the heat REST API directly. heat-api The heat-api component provides an OpenStack-native REST API that processes API requests by sending them to the heat-engine over RPC. heat-api-cfn The heat-api-cfn component provides an AWS Query API that is compatible with AWS CloudFormation and processes API requests by sending them to the heat-engine over RPC. heat-engine The heat engine’s main responsibility is to orchestrate the launching of templates and provide events back to the API consumer.
Heat Architecture (Quick Overview) • Concepts to cover • Stateless (API) • Stateful • DB • MQ • Interfaces • Web-UI • CLI • API
Heat Operational Flow • The user calls the Heat API to create a stack • Ex. "heat stack-create ... myStack" • Heat engine generates a mime multipart data blob that will be consumed by cloud-init • Heat engine asks nova to create an instance with the cloud-init data • Nova selects a compute node to run the instance with the cloud-init data • When the instance boots up, it runs the cloud-init script: • Download the data from the metadata server • Splits the multiple parts into the /var/lib/cloud/ directory • Run the different cloud-initparts • Ex. resize the root filesystem, set the hostname, install the user's SSH key, etc. • cfn-init called at the end of cloud-init • cfn-init loads /var/lib/cloud/data/cfn-init-data and can install packages, setup users & groups, create files, etc.
Heat is HOT (CFN) • The power of Heat is HOT (Heat Orchestration Templates) • Whatever you can do “by hand” (CLI, API, Web-UI) in OpenStack can likely also be executed through a Heat Orchestration Template • Initial goal of Heat was to provide a service comparable to AWS’s “Cloud Formation” • Cloud Formation = “Service Deployment” or “Environment Deployment” • Instead of deploying a single instance, deploy all components to create a service, e.g. 2 web, 2 app, 2 db, networks, routers, etc. • Heat still supports cloud formatting templating (CFN) and JSON • HOT is YAML formatted – Programmatic, data serialized; think of it as Python + XML • Love the recursive acronyms – YAML, “YAML Ain’tMarkup Language” (see references) • Service deployment continues to be the most popular Heat use case • Autoscale also a very popular use case • Heat can leverage Ceilometer metering data and through watermarks and triggers scale
HOT SyntaxWhat does a basic template consist of? • Version <needed for parsing syntax functions / checks> • heat_template_version: 2013-05-23 • Description <free form text field> • description: A template showing how to create a Nova instance, a Cinder volume and attach the volume to the instance. • Paramaters<object definition> • parameters: • key_name: • type: string • description: My sshkeypair, enables SSH access to instance. • default: my_key • Resources <object manipulation> • cinder_volume: • type: OS::Cinder::Volume • properties: • size: { get_param: volume_size} • availability_zone: { get_param: availability_zone } • Outputs <returned data> • instance_ip: • description: Public IP address of the newly created Nova instance. • value: { get_attr: [nova_instance, first_address] }
Like most all OpenStack projects and services Heat can be executed, controlled and polled via the Web-UI, the CLI and the API • Here is a CLI example: • Login to your server as user stack • CD to devstack and Source your OpenStack credentials file • $ cd ~/devstack • $ . openrc • Verify heat is functional • $ heat stack-list • Create or retrieve your template file • $ wget http://jtg.grimmtheory.com/summit/hot/hello-world-1.yaml • Execute the stack • $ heat stack-create helloworld1-stack1 --template-file hello-world-1.yaml • Check progress • $ heat stack-list Heat Execution
Heat Execution (Continued) • Web-UI • Navigate to Projects > Orchestration > Stacks
Heat Execution (Continued) • Web-UI • Click on “Launch Stack” • Choose input method (file, url, direct input), provide link, click next
Heat Execution (Continued) • Web-UI • Name your stack, select rollback, provide admin pass and click launch
Heat Execution (Continued) • Web-UI • View progress
Heat Execution (Continued) • Web-UI • Check completion
Heat Execution (Continued) • Web-UI • Verify results
Heat Demo 33
Demo Environment Setup Notes – Overview • Configuration notes on how this demo environment was setup • MacBook Pro • Retina, 15-inch, Early 2013 • OS X 10.9.2 • 256 GB SSD • 2.7 GHz Intel I7 (8 cores – single socket quad core /w HT) • 16 GB of 1600 MHz DDR3 • VMware Fusion 5.0.4 • Single Virtual Machine • Disk 1 – 20 GB, pre-allocated, broken into 2 GB files (OS and OpenStack) • Disk 2 – 6 GB, pre-allocated, broken into 2 GB files (Cinder-Volumes) • 4 vCPUs • 8 GB RAM • USB, camera, sound, Bluetooth, printer, video acceleration, debugging, etc. off • Hard set VT acceleration, nested hypervisor, etc. support on • Single bridged NIC • Default Ubuntu Server 12.04.4 LTS, x64 installation • Devstack <latest stable git clone>, full details in references section
Getting DevStack configured to use desired services (Heat, Ceilometer, Neutron, etc.) can take some experimentation. • Here are relevant excerpts from my localrc.conf(full version available on site) • [[local|localrc]] • # Set passwords • MYPASS=stack • ADMIN_PASSWORD=$MYPASS • MYSQL_PASSWORD=$MYPASS • RABBIT_PASSWORD=$MYPASS • SERVICE_PASSWORD=$MYPASS • SERVICE_TOKEN=$MYPASS • ... • # Neutron • NEUTRON_BRANCH=master • ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron • ... • # Cinder - Block Device Service • ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak • CINDER_BRANCH=master • CINDER_DRIVER=lvm • ... • # Heat • ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng • IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2" • ... • # Ceilometer • ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api • ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval Demo Environment Setup Notes – DevStack
Heat Demo • We’ll be taking a look at some basic “cloud formation” examples today • Autoscale requires a greater amount of time to setup and HW resources as well • I’ll forward my blog post, video, configuration notes, etc. to the group when I have this demo ready to share • Demos • Hello World 1 (Single Instance) – Configure basics: flavor, image, etc. • Hello World 2 (Single Instance) – Add options for key pair and cinder • Multi Server 1 (Multi Instance) – Deploy web, app, and db tiers
Hello World 1 heat_template_version: 2013-05-23 resources: hello-world-server-1: type: "OS::Nova::Server" properties: name: hello-world-server-1 availability_zone: nova flavor: m1.tiny image: cirros-0.3.0-x86_64-disk networks: [{"uuid": ce967601-b00e-4e0a-a14e-6e3d14eccc36}]
Hello World 2 heat_template_version: 2013-05-23 description: Hello World template 2 resources: hello-world-server-2: type: "OS::Nova::Server" properties: name: hello-world-server-2 key_name: mykey1 availability_zone: nova flavor: m1.tiny image: cirros-0.3.0-x86_64-disk networks: [{"uuid": ce967601-b00e-4e0a-a14e-6e3d14eccc36}] cinder_volume: type: OS::Cinder::Volume properties: size: 1 volume_attachment: type: OS::Cinder::VolumeAttachment properties: volume_id: { get_resource: cinder_volume } instance_uuid: { get_resource: hello-world-server-2 } mountpoint: /dev/vdb
resources: webserver-1: type: "OS::Nova::Server" properties: name: webserver-1 key_name: mykey1 availability_zone: nova flavor: m1.tiny image: cirros-0.3.0-x86_64-disk networks: [{"uuid": 2044872c-7305-4562-a68c-d419273911da}] appserver-1: type: "OS::Nova::Server" properties: name: appserver-1 key_name: mykey1 availability_zone: nova flavor: m1.tiny image: cirros-0.3.0-x86_64-disk networks: [{"uuid": 8d9d9aa3-28c3-43bf-8475-29e2961e0248}] dbserver-1: type: "OS::Nova::Server" properties: name: dbserver-1 key_name: mykey1 availability_zone: nova flavor: m1.tiny image: cirros-0.3.0-x86_64-disk networks: [{"uuid": a62c1be0-dd2f-48a6-b9ec-4d3a9be3fa7a}] cinder_volume: type: OS::Cinder::Volume properties: size: 1 volume_attachment: type: OS::Cinder::VolumeAttachment properties: volume_id: { get_resource: cinder_volume } instance_uuid: { get_resource: dbserver-1 } mountpoint: /dev/vdb Multi Server 1
Heat Group Exercise • Break into teams • Start with one of the existing Heat templates or create one of your own • Add functionality or make adjustments • Test your new configurations
References 42
Reference Information • Heat • Heat main page • Heat developer documentation • Heat operations documentation • Heat main github repository • Heat templates githubrespository • Heat user template guide • Heat developer template guide • Rackerlabs Heat Tutorials • Ironic • Ironic developer documentation • Ironic github repository • Ironic Project Technical Lead video presentation • Other • OpenStack project definitions • This presentation content – Email me for an invite to my public box folder • HOT / YAML syntax • Full references on my personal site