This document discusses using Chef cookbooks to deploy OpenStack. It provides an overview of Chef principles and how they enable infrastructure as code. It then demonstrates how to use roles and run lists to install and configure OpenStack components like Nova on single-machine and multi-node environments. Finally, it outlines ongoing work to enhance OpenStack support and integration using Chef.
3. 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
4. Chef Principles
Idempotent
Data-Driven
Sane Defaults
Easy to Extend
11. OpenStack Installation
‣ Cookbooks uploaded $
$
knife cookbook upload -a
knife cookbook list
$ rake roles
‣ Roles uploaded $ knife role list
$ knife node list
‣ Nodes ready
12. 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
14. 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
15. 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:~$
17. Forked from Anso Labs’ Cookbooks
Bootstrapped by Opscode
Chef Solo/Vagrant installs for Developers
‣ http://github.com/ansolabs/openstack-cookbooks
18. 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)
24. Knife
‣ http://github.com/opscode/knife-openstack
‣ Fog supports OpenStack already
‣ gem install knife-openstack
‣ knife openstack server create ‘role
[base]’ -i ami-a403f6xd -f m1.micro -
A “OpenStack instance”
25. Object Storage (Swift)
‣ Recipes originated from Anso Labs’ repository
‣ Will be managed with Chef and Crowbar
‣ Untested so far (Cactus will tackle)
26. Image Registry (Glance)
‣ Recipes originated from Anso Labs’ repository
‣ Will be managed with Chef and Crowbar
‣ Untested so far (Cactus!)
28. 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
29. Spiceweasel/knife bulkload
‣ yaml/json for describing
infrastructure
‣ generates Chef knife commands
‣ knife bulkload
‣ shareable "best practices"
30. Cactus, Diablo, ...
Development continues...
Crowbar Open Sourced
Branches for each stable release
Design Summit in the Fall
31. 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