velocity 2011 chef openstack workshop
DESCRIPTION
The Deploying OpenStack with Chef section of the OpenStack Workshop from Velocity 2011TRANSCRIPT
![Page 1: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/1.jpg)
Deploying OpenStack with Opscode Chef
![Page 2: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/2.jpg)
Who am I?
• Matt Ray
• Senior Technical Evangelist
• Opscode, Inc.
• Twitter/GitHub/Launchpad/IRC: mattray
![Page 3: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/3.jpg)
Deploying OpenStack is not simple.
![Page 4: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/4.jpg)
Chef makes it easier.
![Page 5: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/5.jpg)
Infrastructure as Code
![Page 6: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/6.jpg)
Enable the reconstruction of the business from
nothing but a source code repository, an application
data backup, and bare metal resources.
![Page 7: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/7.jpg)
Configuration Management
![Page 8: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/8.jpg)
System Integration
http://www.flickr.com/photos/opalsson/3773629074/
![Page 9: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/9.jpg)
![Page 10: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/10.jpg)
The Chef Framework
• Reasonability
• Flexibility
• Library & Primitives
• TIMTOWTDI
![Page 11: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/11.jpg)
The Chef Tool(s)
• ohai
• chef-client
• knife
• shef
![Page 12: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/12.jpg)
The Chef API
• Client/Server
• RESTful API w/ JSON
• Search Service
• Derivative Services
![Page 13: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/13.jpg)
The Chef Community
• Apache License, Version 2.0
• 360+ Individual contributors
• 70+ Corporate contributors
• Dell, Rackspace,VMware, RightScale, Heroku, and many more
• 240+ cookbooks
• http://community.opscode.com
![Page 14: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/14.jpg)
Resourcesopenstack-cookbooks
![Page 15: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/15.jpg)
github.com/mattray/openstack-cookbooks
• Chef repository
• cookbooks
• roles
• data bags
• stable branches
• issues
![Page 16: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/16.jpg)
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
![Page 17: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/17.jpg)
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
![Page 18: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/18.jpg)
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
![Page 19: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/19.jpg)
Chef Cookbooks
• Cookbooks are packages for Recipes
• Recipes
• Assets (files/templates)
• Attributes
• Metadata
• Distributable and managed as Source
• community.opscode.com
![Page 20: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/20.jpg)
OpenStack Cookbooks
• Included
• glance
• nova
• swift
• Installed
• apache2
• apt
• mysql
• openssl
• rabbitmq
![Page 21: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/21.jpg)
Chef Roles
• Roles describe the node.
• Roles have run lists.
• Roles have attributes.
• Roles may contain other roles.
• Searchable.
• Webserver, database, Hadoop-worker, etc.
![Page 22: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/22.jpg)
OpenStack Roles
• nova-single-machine
• nova-db
• nova-rabbitmq-server
• glance-single-machine
• nova-multi-controller
• nova-multi-compute
![Page 23: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/23.jpg)
Chef Data Bags
• Data bags store arbitrary data
• JSON
• Searchable
![Page 24: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/24.jpg)
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
![Page 25: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/25.jpg)
![Page 26: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/26.jpg)
Deploying OpenStack
• Scaling changes how we deploy!
• Single machine works
• Controller + N Computes work(ed)
• Nova and/or Swift installations
• Configurations will be supported, shared & documented
![Page 27: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/27.jpg)
Spiceweasel
• yaml/json for describing infrastructure
• generates knife commands
• shareable "best practices"
• infrastructure.yml included
• bit.ly/spcwsl
![Page 28: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/28.jpg)
Testing OpenStack
• bare-metal to OpenStack
• ~15 minutes
• pxe_dust cookbook
• 2 networks
• admin
• public
![Page 29: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/29.jpg)
knife openstack
![Page 30: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/30.jpg)
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)
![Page 31: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/31.jpg)
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"
![Page 32: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/32.jpg)
knife openstack server create -S mykey -x ubuntu -I ami-4b0ff834 -f m1.tiny -r 'role[webserver]'
![Page 33: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/33.jpg)
How did we get here?
git clone git://github.com/mattray/openstack-cookbooks.git
![Page 34: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/34.jpg)
Origins
• Forked from Anso Labs
• Bootstrapped originally by Opscode
• Chef Solo/Vagrant installs for Developers
• http://github.com/ansolabs/openstack-cookbooks
![Page 35: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/35.jpg)
Crowbar
• OpenStack installer from Dell
• Dell is releasing this under the Apache 2 license
• Extension of the Chef server
• Developed by Dell, Rackspace & Opscode
• http://github.com/dellcloudedge
![Page 36: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/36.jpg)
What's Next?
http://www.flickr.com/photos/felixmorgner/4347750467/
![Page 37: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/37.jpg)
Nova Roadmap
• Improve Glance integration
• Network Types
• Flat, FlatDHCP, VLANs
• Multiple Hypervisors
• Xen, LXC, Hyper-V
• Databases
• PostgreSQL, Drizzle
![Page 38: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/38.jpg)
Swift Roadmap
• Multiple Implementations Available
• Dell• http://github.com/dellcloudedge/openstack-swift
• Voxel• http://www.voxel.net/blog/2011/05/openstack-swift-chef-
and-spiceweasel-part-1-0
• http://github.com/voxeldotnet/openstack-swift-chef
![Page 39: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/39.jpg)
Dashboard
![Page 40: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/40.jpg)
OpenStack Roadmap
• Diablo release
• RHEL 6 & Fedora
• Windows
![Page 41: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/41.jpg)
Get Involved!
• http://github.com/mattray/openstack-cookbooks/tree/cactus
• http://wiki.opscode.com/display/chef/Deploying+OpenStack+with+Chef
• irc.freenode.net #chef #openstack
• Twitter/GitHub/Launchpad/IRC:mattray
![Page 42: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/42.jpg)
Questions?
http://www.flickr.com/photos/mrchippy/443960682/
Questions?
![Page 43: Velocity 2011 Chef OpenStack Workshop](https://reader034.vdocument.in/reader034/viewer/2022052618/554f48ceb4c905b9508b4702/html5/thumbnails/43.jpg)
Thanks!
http://www.opscode.com