Book Image

Mastering OpenStack

By : Omar Khedher
Book Image

Mastering OpenStack

By: Omar Khedher

Overview of this book

Table of Contents (18 chapters)
Mastering OpenStack
About the Author
About the Reviewers
Extending OpenStack – Advanced Networking Features and Deploying Multi-tier Applications


Since its first official release in 2010, OpenStack has distinguished itself as the ultimate open source cloud operating system. Today, more than 200 companies worldwide have joined the development of the OpenStack project, which makes it an attractive cloud computing solution for thousands of organizations. The main reason behind the success of OpenStack is not the overwhelming number of features that it has implemented, but rather its good modularity. Thanks to its vast community around the world, OpenStack is growing very fast. Each release exposes new modules and administrative facilities that offer on-demand computing resources by provisioning a large set of networks of virtual machines. If you are looking for a cloud computing solution that scales out well, OpenStack is an ideal option. Nowadays, it is considered to be a mature cloud computing operating system. Several big, medium, and small enterprises have adopted it as a solution in their infrastructure. The nirvana of OpenStack comes from its architecture. Designing your cloud becomes much easier with more flexibility. It is an ideal solution if you intend either to design a start up cloud environment or to integrate it into your existing infrastructure. As you build your cloud using OpenStack, you will be able to integrate with legacy systems and third-party technologies by eliminating vendor lock-in as much as possible.

This book is designed to discuss what is new in OpenStack with regards to the new features and incubated projects. You will be guided through this book from design to deployment and implementation with the help of a set of best practices in every phase. Each topic is elaborated so that you can see the big and complete picture of a true production environment that runs OpenStack at scale. It will help you decide upon the ways of deploying OpenStack by determining the best outfit for your private cloud, such as the computer, storage, and network components.

If you are ready to start a real private cloud running OpenStack, master the OpenStack design, and deploy and manage a scalable OpenStack infrastructure, this book will prove to be a clear guide that exposes the latest features of the OpenStack technology and helps you leverage its power to design and manage any medium or large OpenStack infrastructure.

What this book covers

Chapter 1, Designing OpenStack Cloud Architecture, will focus on discussing the several components of the architecture of OpenStack. It will provide the basis that is needed to start with the first design of your OpenStack private cloud environment. The chapter will discuss the different models' designs, which will help you begin your first deployment of OpenStack from scratch. The chapter will contain practical examples and calculations that are framed in a theoretical approach to give you an idea about how you can choose the right hardware capacity for your first OpenStack environment and adapt such information to real-world deployments.

Chapter 2, Deploying OpenStack – DevOps and OpenStack Dual Deal, will introduce you to the first installation of the OpenStack environment using automation tools. You will learn how to get the entire infrastructure installed and customized using Chef. The chapter will highlight the adoption of the DevOps approach and cover several advantages of how you can conduct your first OpenStack deployment from a test to production environment with more flexibility. It will provide instructions on how to install and use the Chef cookbooks to install the first test environment and get ready for the production stage.

Chapter 3, Learning OpenStack Clustering – Cloud Controllers and Compute Nodes, will decompose the big parts of your deployment by further refining your design, which was elaborated on in the previous chapter. It will cover some best practices regarding the art of clustering. Next, you will learn how to distribute the main OpenStack services between the cloud controllers and the compute nodes and construct an efficient OpenStack cluster. It will put under the microscope the choice of the hypervisor and hardware specifications. A sample design of the Chef cookbooks will be implemented to help you learn how to automate a cloud controller and install the compute nodes. The chapter will also explore how to plan the backup of an OpenStack cluster.

Chapter 4, Learning OpenStack Storage – Deploying the Hybrid Storage Model, will cover the subject of storage in OpenStack. The chapter will start by focusing on the storage types and their use cases. You will learn about an object storage code named Swift and how it works in OpenStack. A real Swift deployment will be shown to help you calculate the hardware requirements. The chapter will also talk about the block storage code named Cinder in OpenStack. You will learn how to decide which storage type will fulfill your needs. It will also explore Ceph and its main architectural design. It will help you integrate it and install in your test OpenStack environment using Vagrant and Chef.

Chapter 5, Implementing OpenStack Networking and Security, will focus mainly on the networking security features in OpenStack. It will cover the concept of namespaces and security groups in OpenStack and how you can manage them using the Neutron and Nova APIs. In addition, it will explore the new networking security feature, Firewall as a Service. A case study will help you understand another networking feature in Neutron called VPN as a Service.

Chapter 6, OpenStack HA and Failover, will cover the topics of high availability and failover. For each component of the OpenStack infrastructure, this chapter will expose several HA options. The chapter will be replete with HA concepts and best practices, which will help you define the best HA OpenStack environment. It serves as a good complementary chapter for the previous chapters by bringing a geared, distributed, and fault-tolerant OpenStack architecture design. Numerous open source solutions, such as HAProxy, Keepalived, Pacemaker, and Corosync, will be discussed through a step-by-step instruction guide.

Chapter 7, OpenStack Multinode Deployment – Bringing in Production, will be your "first production day" guide. It will focus on how you can deploy a complete multinode OpenStack setup. A sample setup will be explained and described in detail by exposing the different nodes and their roles, the network topology, and the deployment approach. The chapter will contain a practical guide to OpenStack deployment using bare metal provision tools xCAT together with the Chef server. It will demonstrate the first run of a new OpenStack tenant.

Chapter 8, Extending OpenStack – Advanced Networking Features and Deploying Multi-tier Applications, will delve into the advanced OpenStack networking features. It will explain in depth the Neutron plugins such as Linux Bridge and Open vSwitch, how they differ from the architectural perspective, and how instances can be connected to networks with the Neutron plugins. The chapter will also cover Load Balancing as a Service, which is used to load balance the traffic between instances by exploring their fundamental components. In addition, an orchestration module named Heat will be introduced in this chapter and will be used to build a complete stack to show how a real load balancer is deployed in OpenStack.

Chapter 9, Monitoring OpenStack – Ceilometer and Zabbix, will explore another new incubated project called Ceilometer as a new telemetry module for OpenStack. The chapter will discuss briefly the architecture of Ceilometer and how you can install and integrate it into the existing OpenStack environment. The discussion on Heat will be resumed, and it will be used to expand a stack installation including Ceilometer. The purpose of this is to discover the capabilities of heat with regard to supporting the Ceilometer functions, such as alarms and notifications. This section will also make sure that the OpenStack environment is well-monitored using some external monitoring tools such as Zabbix for advanced triggering capabilities.

Chapter 10, Keeping Track for Logs – Centralizing Logs with Logstash, will talk about the problem of logging in OpenStack. The chapter will present a very sophisticated logging solution called Logstash. It will go beyond the tailing and grepping of single log lines to tackle complex log filtering. The chapter will provide instructions on how to install Logstash and forward the OpenStack log files to a central logging server. Furthermore, a few snippets will be be provided to demonstrate the transformation of the OpenStack data logs and events into elegant graphs that are easy to understand.

Chapter 11, Tuning OpenStack Performance – Advanced Configuration, will wrap things up by talking about how you can make the OpenStack infrastructure run better with respect to its performance. Different topics, such as the advanced configuration in the exiting OpenStack environment, will be discussed. The chapter will put under the microscope the performance enhancement of MySQL by means of hardware upgrade and software layering such as memcached. You will learn how to tune the OpenStack infrastructure component-by-component using a new incubated OpenStack project called Rally.

What you need for this book

This book assumes a moderate level of Linux system administration and cloud computing concepts' experience. Though this book will walk you through some snippets of real-life production environment running OpenStack, some rudimentary knowledge of the OpenStack components may be required. In addition to this, a basic knowledge and understanding of networking jargon and connectional design is required. If you possess some Ruby programming skills, this is a plus. The book does not specify any specific test environment. Feel free to use any lab environment that you feel more comfortable with, such as Oracle's VirtualBox, Vagrant, or the VMware workstation.

This book requires you to install and run OpenStack on physical hardware to support bare metal provisioning and, for this, a physical network infrastructure should be in place.

In this book, the following essential software is required:

  • Operating System: CentOS 6.5

  • The following software is required:

    • OpenStack—Havana or a later version

    • The Chef server

    • Vagrant

    • VirtualBox

Internet connectivity will be required to install the OpenStack packages and several other packages. Make sure that you use the most convenient hardware to perform tests of the snippets described in each chapter of this book.

Who this book is for

To speed up with the content of this book, prior knowledge of OpenStack is required. If you don't have experience in OpenStack, reading small snippets from the OpenStack community,, will bring you onto the same wavelength of this book. As the title of the book promises, you should not expect a long and detailed tutorial on the installation of OpenStack. Although some chapters provide specific details concerning the installation of the new components, you are expected to have some basic knowledge on how it works in general so that you can turn your focus to the advanced methods and tricks that treat the topic at hand. This book is essentially for the novice cloud and technical architects and the system administrators who are willing to deploy a cloud based on OpenStack in a medium to large IT infrastructure. The book is also meant for those who have already deployed an OpenStack environment and who are willing to discover new features and expand their knowledge of how this technology works and how you can integrate new incubated projects during the operational phase.


In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Create a new role named packtpub-os-compute-worker.json."

A block of code is set as follows:


When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

input  {
. . . 
  if [type] == "openstack" {
    grok {
      patterns_dir => "/opt/logstash/patterns/"
      match=>[ "message","%{TIMESTAMP_ISO8601:timestamp} %{NUMBER:response} %{AUDITLOGLEVEL:level} %{NOTSPACE:module} \[%{GREEDYDATA:program}\] %{GREEDYDATA:content}"]

Any command-line input or output is written as follows:

# yum clean all
# yum update –y
# yum install nginx redis –y

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "To install Ruby, you need to go from the Eclipse menu bar and navigate to Help | Install New Software."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.