OpenStack Cloud Computing Cookbook

Category Archives: OpenStack

May the fourth be with you!

4th Edition Cover

4th Edition Cover

It is with immense pleasure that we bring to you the 4th Edition of the OpenStack Cloud Computing Cookbook by Packt Publishing!

Brought to you by 4 talented authors from Rackspace: Kevin Jackson, Cody Bunch, Egle Sigler and James Denton; a host of tenacious technical reviewers: Christian Ashby, Stefano Canepa, Ricky Donato, Geoff Higginbottom, Andy McCrae, and Wojciech Sciesinski; and a Packt team keeping us in check!

We have listened to your feedback and attempted to bend as many rules as we can to bring you a book that will help you understand, deploy and operate an OpenStack cloud environment.

When the 1st Edition was written in 2012, I didn’t think I’d still be updating it today to make a 4th Edition! Thank you to everyone involved. To the clever people that helped bring this to fruition, I thank you. To our readers – please enjoy!

UK Amazon:

US Amazon:




Thinking of taking the #OpenStack Certified Administrator exam? Up to 50% Off OpenStack Books!


Get your learning on ahead of the OpenStack Certified Administrator exam by purchasing the above books written by Rackspace OpenStack authors!

OpenStack Cloud Computing Cookbook, 3rd Edition by Kevin Jackson, Cody Bunch and Egle Sigler

-50% on eBook code is OCCTE50   (
-30% on print code is OCCTE30   (

Learning OpenStack Networking (Neutron), 2nd Edition by James Denton

-50% on eBook code is LSNNSE50   (
-30% on print code is LSNNSE30  (

OpenStack Administration with Ansible by Walter Bentley

-50% on eBook code is CONEB50osaa   (
-30% on print  code is CONPRT50osaa  (

Two must have OpenStack books, up to 30% off!

IMG_20160115_154450.jpgGet up to 30% off a copy of the OpenStack Cloud Computing Cookbook (3rd Edition) and Learning OpenStack Networking (Neutron) 2nd Edition using the codes below!

OpenStack Cloud Computing Cookbook, 3rd Edition

30% off eBook with code OSCCC3E
25% off print with
 code OSCCC3P

Learning OpenStack Neutron (Networking), 2nd Edition
30% off eBook with code LOSN2E
25% off print with code LOSN2P

Offer valid from Friday 15th January to 31st January 2016

Book Discount Codes; Love in Tokyo

Understand, install, configure, and manage Nova

Understand, install, configure, and manage Nova

It’s time to say sayonara to the OpenStack Summit in Tokyo, but never fear, if you weren’t one of the lucky Stackers to grab one of the signed copies of the OpenStack Cloud Computing Cookbook or Learning OpenStack Networking (Neutron) then use the following codes:

50% Off ebook: OpenStack50

30% Off print: OpenStack30

These codes are valid until November 15th direct from PacktPub. The print copy includes the ebook too in non DRM format to use on whatever device you use.

More information can be found here:

Feedback on the book – dealing with Amazon reviews

We really do appreciate our readers taking the time and effort to write reviews of our book. We actively encourage feedback and this is presented in the book on how to do this. As we maintain a very active GitHub repository of a complete working OpenStack environment, code and examples – we positively encourage people to give us feedback so we can improve our code and writing.

UPDATE: The reviewer contacted us to say how happy he was to have his concerns addressed and as a result, the review has been removed. Thank you. I have removed references to emails so this post offers a guide to future reviewers on how to give us feedback. 

The problem with reviews is that it tends to be a one-sided conversation though, with us only being able to respond to the damage that has already been done. We were recently alerted to a 2-star Amazon review [Edit: Now removed] that contradicted conversations that I’d had with the reviewer. We thought the best way to address this was by explaining why the review is incorrect. A rebuttal 5-star review by an author would help fix the ratings – as people do judge Amazon books by the star ratings – but would be false and equally damaging.

Fortunately in this incident, I had a 2-way conversation with this reviewer. It started on Twitter then progressed to email.

The first issue was to raise awareness around syntax used in the book and the use of under_scores and not hyphen-ated flags.

This is perfectly valid syntax as shown below:


The example used in the review incorrectly asserts that the syntax we used is not valid. This is also mythbusted below too:


The neutron client allows both. Arguments exist for what would be more correct, but to say it is invalid is completely wrong.

The second issue was that of the Kindle version introducing extra spaces in the syntax. In the PDF there are no such spaces:


How to give feedback

Please contact any of us on Twitter, or email book @, fill in bug information on GitHub regarding the environment and scripts not working, or directly with the Publisher. You can follow us and comment on G+ and you can like or post messages on Facebook. You can even leave a comment below.

The OpenStack Cloud Computing Cookbook – Third Edition – is now available to purchase!

Thanks to Cody Bunch and Egle Sigler – and whole bunch of tech reviewers spanning the cloud and OpenStack community, the OpenStack Cloud Computing Cookbook has had its 3rd reboot. We cover configuration of Nova, Neutron, Glance, Keystone, Cinder and Swift. We show you how to use these. We show you how to use Ansible to deploy this in your datacentre. We show you how to use things like Heat and Cloud-Init to automate your cloud application environments as well as the latest and greatest like DVR and FWaaS.

We provide this with an accompanying multi-node Vagrant environment, where you can try out the steps in the book using free and open source stools such as VirtualBox and Vagrant – and we always make the latest versions of OpenStack available here too.

This is the best book in the series by far and now it’s available to buy here.

-Kevin Jackson

Installing and Configuring OpenLDAP

In order to operate OpenStack Identity service with an external authentication source, it is necessary that one have an external authentication service available. In the OpenStack Cloud Computing Cookbook, we used OpenLDAP. As installing and configuring OpenLDAP is beyond the scope of the book, that information is provided here.

Getting ready

We will be performing an installation and configuration of OpenLDAP on it’s own Ubuntu 14.04 server.

How to do it…

We will break this into two steps: installing OpenLDAP, and configuring it for use with OpenStack.

Installing OpenLDAP

Once you are logged in, to your Ubuntu 14.04 node, run the following commands to install OpenLDAP:
We set the Ubuntu installer to non-interactive, as we will be providing the configuration values for OpenLDAP prior to installation:

export DEBIAN_FRONTEND=noninteractive

Next we provide an admin password so OpenLDAP will install:

echo -e " \
slapd slapd/internal/generated_adminpw password openstack
slapd slapd/password2 password openstack
slapd slapd/internal/adminpw password openstack
slapd slapd/password1 password openstack
" | sudo debconf-set-selections

Finally, we install OpenLDAP via slapd package:

sudo apt-get install -y slapd ldap-utils


OpenStack has a few requirements regarding which attribute types are used for user information. To accomodate this in our OpenLDAP we need to add these values to the new-attributes schema file:

sudo echo "
 attributetype ( 1.2.840.113556.1.4.8 NAME 'userAccountControl'
 SYNTAX '' )
objectclass ( 1.2.840.113556.1.5.9 NAME 'user'
 DESC 'a user'
 MUST ( cn )
 MAY ( userPassword $ memberOf $ userAccountControl ) )
" >> /etc/ldap/schema/new-attributes.schema

Finally, restart OpenLDAP:

sudo service slapd restart

How it works…

What we have done here is install OpenLDAP on Ubuntu 14.04. Additionally we created an LDAP schema, configuring the userAccountControl property, and configuring a ‘user’ object to provide login authorization.

Pens down. It’s a wrap! OpenStack Cloud Computing Cookbook 3rd Edition coming soon!

B04127_MockupCover_CookbookLate Friday night July 3rd 2015, or early evening to my US counterparts, we finished the edits on the OpenStack Cloud Computing Cookbook, 3rd Edition. Wow – 3 Editions.

I started writing the first edition back in 2011. Back then, OpenStack Diablo was THE production ready release. It had many promises and I was keen to learn more after dipping my toes into the OpenStack water with the Bexar release months before. Of course, I pronounced this wrong. So much for a country who frowns upon our additional characters in the English language.

This book was very popular and has taken me on a journey I wasn’t expecting. As time went on, Diablo wasn’t as hot property as it sounds and after being approached by none other than Cody Bunch who convinced me to write another, the 2nd Edition was needed. This was another 10 months getting a “few updates” in the book. This was published in June 2013 and was based on Grizzly.

Fast forward towards the end of 2014 and through a mental lapse, Cody yet again thought it might be a good idea to do another. Along the way of ideas, we picked up the esteemed Egle Sigler. Putting in a few more updates and with 50% more help, this would be a breeze to get the book updated for Juno. Or so we thought.

About 8 months later, we made it. We have updated sections that include how to install the very latest OpenStack Kilo using Ansible. Over 110 recipes has had an upgrade, rewrite or is a brand new addition to the book. We listened and we have a book that takes you through all the essential components and much more. We take you through step by step instructions on how you could run this in your datacentres.

We wouldn’t have made this possible without the immense valuable feedback from our tech reviewers. Thank you for keeping us on track and making this book even better than it was going to be:

Andy McCrae, Sriram Rajan, Melissa Palmer, Stefan Lenz, Chris Beatty, Walter Bentley and Victoria Martínez de la Cruz.

And a big shout out to Tim Bell for writing an excellent foreword to the book. We are truly honoured. I’m expecting a signed copy from him in the post.

So go out and by the thing. You won’t regret it.

Kevin Jackson

Pre-Requisites for the OpenStack Cloud Computing Cookbook lab

The OpenStack Cloud Computing Cookbook has been written in such a way so that our readers can follow each section to understand, install and configure each component of the OpenStack environment. We cover Compute (Nova), Identity (Keystone), Image (Glance), Networking (Neutron), Storage (Cinder and Swift) as well as many other services such as how to install these components using Ansible. As such, there are elements of the OpenStack environment that don’t fit in any particular chapter. These supporting services are:

Installing RabbitMQ for OpenStack Cloud Computing Cookbook

The examples in the OpenStack Cloud Computing Cookbook assumes you have a suitable messaging service backend configured to run the OpenStack services. This didn’t fit with any single chapter or service as nearly all rely on something like RabbitMQ. If you don’t have this installed, follow these steps which you should be able to copy and paste to run in your environment. Warning: The steps below do not assume security best practices as we allow the guest user to connect in our environment from any of our OpenStack services.

Getting ready

We will be performing an installation and configuration of RabbitMQ on the Controller node that is shown in the diagram. There are other messaging systems that are available for use with OpenStack such as QPID and ZeroMQ, but we concentrate on the most widely used which is RabbitMQ. In the examples through the book, the IP address of the Controller that this will be on, and will be used by the services in the book, will be

OpenStack Cloud Computing Cookbook Lab Environment

How to do it…

To install RabbitMQ, carry out the following steps

Tip: A script is provided here for you to run the commands below

  1. We install the required packages with the following command
    sudo apt-get install rabbitmq-server
  2. We then create a very simple config file that allows guest users to connect remotely with the following
    cat > /etc/rabbitmq/rabbitmq.config <<EOF
    [{rabbit, [{loopback_users, []}]}].
  3. And then we set RabbitMQ to listen on port 5672
    cat > /etc/rabbitmq/rabbitmq-env.conf <<EOF
  4. We pick up the changes made by restarting RabbitMQ with the following command
    service rabbitmq-server restart

How it works…

What we have done here is install and configure RabbitMQ on our Controller node that is hosted with address When we configure our OpenStack services that required a RabbitMQ connection, they will use the the following format:

rabbit_host =
rabbit_port = 5672
rabbit_use_ssl = false
rabbit_userid = guest
rabbit_password = guest
rabbit_virtual_host = /