Seattle OpenStack Meetup

of 40 /40
Deploying OpenStack with Opscode Chef [email protected] www.opscode.com Thursday, October 20, 2011

description

Sarah Novotny and Matt Ray's presentation from the Seattle OpenStack Meetup on 10/19/2011. Covered Chef basics and a snapshot of the current state of OpenStack cookbook development.

Transcript of Seattle OpenStack Meetup

Page 1: Seattle OpenStack Meetup

Deploying OpenStack with Opscode Chef

[email protected]

Thursday, October 20, 2011

Page 2: Seattle OpenStack Meetup

Who am I?

• Sarah Novotny

• Senior Field Architect

• Opscode, Inc.

• @sarahnovotny

• irc: senk

!"#$#%&'$()#)*$+),*-./$

Thursday, October 20, 2011

Page 3: Seattle OpenStack Meetup

Deploying OpenStack is not simple.

Thursday, October 20, 2011

Page 4: Seattle OpenStack Meetup

Chef makes it easier.

Thursday, October 20, 2011

Page 5: Seattle OpenStack Meetup

Infrastructure as Code

Thursday, October 20, 2011

Page 6: Seattle OpenStack Meetup

Enable the reconstruction of the business from

nothing but a source code repository, an application

data backup, and bare metal resources.

Thursday, October 20, 2011

Page 7: Seattle OpenStack Meetup

Configuration Management

Thursday, October 20, 2011

Page 8: Seattle OpenStack Meetup

System Integration

http://www.flickr.com/photos/opalsson/3773629074/

Thursday, October 20, 2011

Page 9: Seattle OpenStack Meetup

Thursday, October 20, 2011

Page 10: Seattle OpenStack Meetup

The Chef Framework

• Reasonability

• Flexibility

• Library & Primitives

• TIMTOWTDI

Thursday, October 20, 2011

Page 11: Seattle OpenStack Meetup

The Chef Tool(s)

• ohai

• chef-client

• knife

• shef

Thursday, October 20, 2011

Page 12: Seattle OpenStack Meetup

The Chef API

• Client/Server

• RESTful API w/ JSON

• Search Service

Thursday, October 20, 2011

Page 13: Seattle OpenStack Meetup

Chef Nodes

• Each system you manage is called a node.

• The chef-client runs on nodes.

• The ohai discovery agent runs on nodes.

• Nodes have a run list.

• Searchable

Thursday, October 20, 2011

Page 14: Seattle OpenStack Meetup

Chef Resources

• Have a type.

• Have a name.

• Have parameters.

• Take action to put the resource in the declared state.

• Can send notifications to other resources.

• Take action through Providers

package "haproxy" do action :installend

template "/etc/haproxy/haproxy.cfg" do source "haproxy.cfg.erb" owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]"end

service "haproxy" do supports :restart => true action [:enable, :start]end

Thursday, October 20, 2011

Page 15: Seattle OpenStack Meetup

extra_packages = case node[:platform] when "ubuntu","debian" %w{ ruby1.8 ruby1.8-dev rdoc1.8 ri1.8 libopenssl-ruby } end

extra_packages.each do |pkg| package pkg do action :install endend

Chef Recipes

• Ordered list of Resources

• Idempotent execution

• Ruby

Thursday, October 20, 2011

Page 16: Seattle OpenStack Meetup

Chef Cookbooks

• Cookbooks are packages for Recipes

• Recipes

• Assets (files/templates)

• Attributes

• Metadata

• Distributable and managed as Source

• community.opscode.com

Thursday, October 20, 2011

Page 17: Seattle OpenStack Meetup

Chef Roles

• Roles describe the node.

• Roles have run lists.

• Roles have attributes.

• Roles may contain other roles.

• Searchable.

• Webserver, database, Hadoop-worker, etc.

Thursday, October 20, 2011

Page 18: Seattle OpenStack Meetup

Chef Data Bags

• Data bags store arbitrary data

• JSON

• Searchable

Thursday, October 20, 2011

Page 19: Seattle OpenStack Meetup

The Chef Community

• Apache License, Version 2.0

• 400+ Individual contributors

• 90+ Corporate contributors

• Dell, Rackspace,VMware, RightScale, Heroku, and many more

• 300+ cookbooks

• http://community.opscode.com

Thursday, October 20, 2011

Page 20: Seattle OpenStack Meetup

Resourcesopenstack-cookbooks

Thursday, October 20, 2011

Page 21: Seattle OpenStack Meetup

github.com/opscode/openstack-chef-repo

• Chef repository

• cookbooks

• roles

• data bags

• diablo & essex milestones

• issues

Thursday, October 20, 2011

Page 22: Seattle OpenStack Meetup

OpenStack Cookbooks

• Included

• glance

• nova

• swift

• Future

• dashboard

• keystone

Thursday, October 20, 2011

Page 23: Seattle OpenStack Meetup

OpenStack Roles

• nova-single-machine

• nova-db

• nova-rabbitmq-server

• glance-single-machine

• nova-multi-controller

• nova-multi-compute

• bit.ly/OSChef will receive a major update at or before the OpenStack dev conference

Thursday, October 20, 2011

Page 24: Seattle OpenStack Meetup

Thursday, October 20, 2011

Page 25: Seattle OpenStack Meetup

OpenStack Data Bags

knife data bag create openstack

knife data bag from file openstack defaults.jsonknife data bag from file openstack glance.jsonknife data bag from file openstack images.json

knife data bag show openstack imagesid: imagesimages: http://uec-images.ubuntu.com/lucid/current/ubuntu-10.04-server-uec-amd64.tar.gz: arch: x86_64 distro: Ubuntu image: lucid-server-uec-amd64.img kernel: lucid-server-uec-amd64-vmlinuz-virtual version: 10.04

Thursday, October 20, 2011

Page 26: Seattle OpenStack Meetup

Deploying OpenStack

• Scaling changes how we deploy

• Nova installation with Glance, Keystone & Dashboard

• Production-ready Swift soon

• Lightweight HA

• Upgradeable

• Configurations will be supported, shared & documented

Thursday, October 20, 2011

Page 27: Seattle OpenStack Meetup

Spiceweasel

• yaml/json for describing infrastructure

• generates knife commands

• shareable "best practices"

• infrastructure.yml included

• bit.ly/spcwsl

Thursday, October 20, 2011

Page 28: Seattle OpenStack Meetup

Testing OpenStack

• bare-metal to OpenStack

• ~15 minutes

• pxe_dust cookbook

• 2 networks

• admin

• public

Thursday, October 20, 2011

Page 29: Seattle OpenStack Meetup

Crowbar

• OpenStack installer from Dell

• Components are "barclamps"

• Dell released this under the Apache 2 license

• Extension of the Chef server

• Developed by Dell, Rackspace & Opscode

• https://github.com/dellcloudedge/crowbar

Thursday, October 20, 2011

Page 30: Seattle OpenStack Meetup

knife openstack

Thursday, October 20, 2011

Page 31: Seattle OpenStack Meetup

knife openstack

$ gem install knife-openstack

$ knife openstack** OPENSTACK COMMANDS **knife openstack server list (options)knife openstack flavor list (options)knife openstack server create (options)knife openstack server delete SERVER [SERVER] (options)knife openstack image list (options)

Thursday, October 20, 2011

Page 32: Seattle OpenStack Meetup

knife.rb

knife[:openstack_access_key_id] = "MeMpLexdnjmXeXGMx:admin"knife[:openstack_secret_access_key] = "nFjXAKl5G6VaXE3bVuwi"knife[:openstack_api_endpoint] = "http://192.168.11.9:8773/services/Cloud"

Thursday, October 20, 2011

Page 33: Seattle OpenStack Meetup

knife openstack server create -S mykey -x ubuntu -I ami-4b0ff834 -f m1.tiny -r 'role[webserver]'

Thursday, October 20, 2011

Page 34: Seattle OpenStack Meetup

What's Next?

http://www.flickr.com/photos/felixmorgner/4347750467/

Thursday, October 20, 2011

Page 35: Seattle OpenStack Meetup

Nova Roadmap

• Diablo support is under active development

• Network Types

• Flat, FlatDHCP, VLANs, HA DHCP

• Multiple Hypervisors

• KVM, Xen, LXC, Hyper-V

• Databases

• PostgreSQL, Drizzle

Thursday, October 20, 2011

Page 36: Seattle OpenStack Meetup

Swift Roadmap

• Diablo support is next for active development

• Rackspace has a lot of operational experience to incorporate

• Other vendors will collaborate

• Ceph?

Thursday, October 20, 2011

Page 37: Seattle OpenStack Meetup

OpenStack Roadmap

• Diablo release (RCB patches)

• Reference Architectures

• Essex milestones (RCB patches)

• More collaborators

• RHEL 6 & Fedora

• Windows

Thursday, October 20, 2011

Page 39: Seattle OpenStack Meetup

Questions?

http://www.flickr.com/photos/mrchippy/443960682/

Questions?

Thursday, October 20, 2011

Page 40: Seattle OpenStack Meetup

Thanks!

http://www.opscode.com

Thursday, October 20, 2011