In this series of post I will demonstrate deploying OpenStack with Chef, using Rackspace Private Cloud’s cookbooks. This guide largely follows Rackspace’s documentation (Getting Started Guide, list of documentation), with notes by myself.
One thing to clarify is that Chef doens’t do the bootstrapping of nodes for you. I misunderstood this at first. You need to install and configure the OS, networking, network bridges required by Neutron manually.
My setup will be
- controller node: x.y.54.50, 172.17.1.1
- compute node: x.y.54.51, 172.17.1.2
- network node: x.y.54.54, 172.17.1.5, runs Neutron, with OVS plugin and GRE tenant network
- storage node: x.y.54.53, 172.17.1.4, runs Cinder
Each node has 2 interfaces, first one (not necessarily
eth0, since there will be
br-ex on network node) connects to public network x.y.54.0/24, each node has a public IP address; the second interface connects to a private subnet 172.17.1.0/24 .
First install Ubuntu 12.04 on each node, set up public IP addresses on eth0 so that you can access by SSH, we’ll reconfigure some part of them later.
chef-server stores the environment file, cookbooks, roles for each node.
Environment file describes your environment by overriding default attributes.
Cookbooks are chain of actions to bring the node to certain “state", cookbook are collections of attributes and recipes.
Role is a role for a machine, a role can be composed of many recipes and certain attributes or even other roles.
chef-server needs not to be in the same subnet as the nodes, it only needs to be accesible by all nodes. Putting chef-server on the Internet is also entirely fine.
chef-client needs to be installed on all nodes, whenever you run chef-client, it contacts chef-server and see if there’s any change of the environment or the role of the node. It updates the node to desired state by executing recipes.
Also take a look at http://www.rackspace.com/knowledge_center/article/rackspace-private-cloud-installation-prerequisites-and-concepts
Install chef-server and bootstrap the nodes
I highly recommend setting up FQDN for all nodes and chef-server, and set up SSH passwordless login for root on each node.
Put id_rsa in the chef-server, copy id_rsa.pub to all nodes.
chef-server should be acessible by all nodes at port 443 and 80.
Make sure all nodes and chef-server’s hostname are correctly configured.
/etc/hostname should contain
/etc/hosts should have entry like this:
x.y.54.50 controller.openstack.example.com controller
Then just follow Rackspace’s guide: Install Chef Server, Cookbooks, and chef-client
"description": "OpenStack Demo : Swarm 1",
horizon part is the fix for this bug. Additionaly, patch
chef-cookbooks/cookbooks/horizon/recipes/server.rb like this patch. More information on this bug
Provider network settings like below is not needed in GRE setup. (They had it on Getting Started Guide p.33 so I misunderstood that I need it)
osops_networks section defines networks that services should listen on (endpoints). Following list is copied from Rackspace Private Cloud Installation Prerequisites and Concepts.
nova network should be accessible by future Horizon user, since the VNC proxy (
nova-novnc-proxy) listens on that network, it must be accessible by clients so that their VNC console in Horizon will work. In nearly all cases you should put
public on the same network.
Chef will not set up these networks for you. During chef-client run of each node, it searches for the node’s IP on that network, and bind (some) services to that IP. For example, my management network is on 172.17.1.0/24, when deploying
mysql on the controller node, chef-client searches for the node’s IP on that network, the node actually have 2 IPs, x.y.54.50 and 172.17.1.1, so it binds mysql to 172.17.1.1 .