Presentation from the Spring 2011 OpenStack Design Summit. Blueprint URL is https://blueprints.launchpad.net/openstack-devel/+spec/openstack-deployment-cookbooks
Chef enables infrastructure as code
package "haproxy" do
‣ Manage configuration action :install
end
as idempotent
Resources. template "/etc/haproxy/haproxy.cfg" do
source "haproxy.cfg.erb"
‣ Put them together in owner "root"
group "root"
Recipes. mode 0644
notifies :restart, "service[haproxy]"
‣ Track it like Source end
Code. service "haproxy" do
action [:enable, :start]
‣ Configures your servers. end
Chef Principles
Idempotent
Data-Driven
Sane Defaults
Easy to Extend
OpenStack Installation
‣ Cookbooks uploaded $
$
knife cookbook upload -a
knife cookbook list
$ rake roles
‣ Roles uploaded $ knife role list
$ knife node list
‣ Nodes ready
AMIs
name "nova-ami-urls"
description "Feed in a list URLs for AMIs to download"
default_attributes(
"nova" => {
"images" =>
["http://192.168.11.7/ubuntu1010-UEC-localuser-image.tar.gz”]
}
)
$ knife role from file roles/nova-ami-urls.rb
‣ Use an existing AMI
‣ Update URL to your own
chef-client
$ sudo chef-client
[Fri, 25 Feb 2011 11:52:59 -0800] INFO: Starting Chef Run (Version
0.9.12)
...
[Fri, 25 Feb 2011 11:56:05 -0800] INFO: Chef Run complete in
5.911955 seconds
[Fri, 25 Feb 2011 11:56:05 -0800] INFO: cleaning the checksum cache
[Fri, 25 Feb 2011 11:56:05 -0800] INFO: Running report handlers
[Fri, 25 Feb 2011 11:56:05 -0800] INFO: Report handlers complete
The Moment of Truth
nova@$ nova-manage service list
nova@$ euca-describe-images
nova@$ euca-run-instances ami-h8wh0j17 -k mykey -t m1.small
nova@$ euca-describe-instances
nova@$ ssh -i mykey.priv ubuntu@10.0.0.2
Linux i-00000001 2.6.35-24-virtual #42-Ubuntu SMP Thu Mar 30
05:15:26 UTC 2011 x86_64 GNU/Linux
Ubuntu 10.10
Welcome to Ubuntu!
<SNIP>
See "man sudo_root" for details.
ubuntu@i-00000001:~$
Forked from Anso Labs’ Cookbooks
Bootstrapped by Opscode
Chef Solo/Vagrant installs for Developers
‣ http://github.com/ansolabs/openstack-cookbooks
Crowbar
‣OpenStack installer from
Dell
‣ Dell is releasing this under the Apache 2
license
‣ Extension of the Chef server
‣ Jointly developed by Dell, Rackspace
and Opscode
‣ Bootstrapping Hyperscale Clouds
(Yosemite 3:45 today)
Deployment Scenarios
‣ Controller + Compute nodes is a known quantity
for small installations
‣ Nova + Swift + Glance in large installations
‣ Services separated and HA configurations
supported
‣ Real-world experiences
‣ Documentation and Chef Roles will be the
solution
Spiceweasel/knife bulkload
‣ yaml/json for describing
infrastructure
‣ generates Chef knife commands
‣ knife bulkload
‣ shareable "best practices"
Cactus, Diablo, ...
Development continues...
Crowbar Open Sourced
Branches for each stable release
Design Summit in the Fall
Get Involved!
http://github.com/mattray/openstack-cookbooks/tree/cactus
http://wiki.opscode.com/display/chef/Deploying+OpenStack
+with+Chef (aka bit.ly/OSChef)
http://lists.opscode.com
#chef on irc.freenode.net
matt@opscode.com
Twitter/GitHub/Launchpad:mattray