




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Credits
Author
Kevin Jackson
Reviewers
Thierry Carrez Atul Kumar Jha
Acquisition Editor
Kartikey Pandey
Lead Technical Editor
Azharuddin Sheikh
Technical Editors
Veronica Fernandes Azharuddin Sheikh Prasad Dalvi Joyslita D'Souza
Copy Editor Brandt D'Mello
Project Coordinator Yashodhan Dere
Proofreader Kevin McGowan
Indexer Tejal R. Soni
Production Coordinator Nilesh R. Mohite
Cover Work Nilesh R. Mohite
About the Author
with small businesses and online enterprises. He has extensive experience with various flavors of Linux and Unix. He specializes in web and cloud infrastructure technologies for Trader Media Group.
I'd like to thank my wife, Charlene, and the rest of my family for their time, patience, and encouragement throughout the book.
I'd also like to extend my thanks to the OpenStack community, which has helped a great deal during my journey with OpenStack. The talent and support is phenomenal. Without the OpenStack community, there would be no OpenStack.
A specific mention goes to all those who have made this book possible. Your comments, guidance, and motivation have made writing this book an enjoyable experience.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
iii
iv
2
What this book covers
Chapter 1 , Starting OpenStack Compute , teaches you how to set up and use OpenStack Compute running within a VirtualBox environment.
Chapter 2, Administering OpenStack Compute , teaches you how to manage user accounts and security groups as well as how to deal with cloud images to run in an OpenStack environment.
Chapter 3 , Keystone OpenStack Identity Service , takes you through installation and configuration of Keystone, which underpins all of the other OpenStack services.
Chapter 4 , Installing OpenStack Storage , teaches you how to configure and use OpenStack Storage running within a VirtualBox environment.
Chapter 5 , Using OpenStack Storage , teaches you how to use the storage service for storing and retrieving files and objects.
Chapter 6 , Administering OpenStack Storage , takes you through how to use tools and techniques that can be used for running OpenStack Storage within datacenters.
Chapter 7 , Glance OpenStack Image Service , teaches you how to upload and modify images (templates) for use within an OpenStack environment.
Chapter 8 , Nova Volumes , teaches you how to install and configure the persistent storage service for use by instances running in an OpenStack Compute environment.
Chapter 9 , Horizon OpenStack Dashboard , teaches you how to install and use the web user interface to perform tasks such as creating users, modifying security groups, and launching instances.
Chapter 10 , OpenStack Networking , helps you understand the networking options currently available as well as teaching you how to configure an OpenStack environment so that instances are accessible on the network.
Chapter 11 , In the Datacenter , takes you through understanding how to do bare-metal provisioning, scale up OpenStack, and introduces you to adding resilience to our OpenStack installations for high availability.
Chapter 12 , Monitoring , shows you how to install and configure various open source tools for monitoring an OpenStack installation.
Chapter 13 , Troubleshooting , takes you through an understanding of the logs and where to get help when encountering issues while running an OpenStack environment.
3
What you need for this book
To use this book, you will need access to computers or servers that have hardware virtualization capabilities. To set up the lab environments you will need Oracle's VirtualBox installed. You will also need access to an Ubuntu 12.04 ISO image, as the methods presented detail steps for Ubuntu environments.
Who this book is for
This book is aimed at system administrators and technical architects moving from a virtualized environment to cloud environments who are familiar with cloud computing platforms. Knowledge of virtualization and managing Linux environments is expected. Prior knowledge or experience of OpenStack is not required, although beneficial.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "Similar information is presented by the nova list and nova show commands".
A block of code is set as follows:
bind_port = 443 cert_file = /etc/swift/cert.crt key_file = /etc/swift/cert.key
Any command-line input or output is written as follows:
sudo apt-get update
sudo apt-get -y install qemu-kvm cloud-utils
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "In the INSTANCE section, we get details of our running instance".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
In this chapter, we will cover:
f Creating a sandbox environment with VirtualBox f Installing OpenStack Compute packages f Configuring database services f Configuring OpenStack Compute f Stopping and starting Nova services f Creating a cloudadmin account and project f Installation of command-line tools f Uploading a sample machine image f Launching your first cloud instance f Terminating your instance
6
OpenStack Compute, also known as Nova, is the compute component of the open source cloud operating system, OpenStack. It is the component that allows you to run multiple instances of virtual machines on any number of hosts running the OpenStack Compute service, allowing you to create a highly scalable and redundant cloud environment. The open source project strives to be hardware and hypervisor agnostic. Nova compute is analogous to Amazon's EC2 (Elastic Compute Cloud) environment and can be managed in a similar way, demonstrating the power and potential of this service.
This chapter gets you up to speed quickly by giving you the information you need to create a cloud environment running entirely from your desktop machine. At the end of this chapter, you will be able to create and access virtual machines using the same command line tools you would use to manage Amazon's own EC2 compute environment.
Creating a sandbox environment using VirtualBox allows us to discover and experiment with the OpenStack Compute service, known as Nova. VirtualBox gives us the ability to spin up virtual machines and networks without affecting the rest of our working environment and is freely available from http://www.virtualbox.org for Windows, Mac OSX, and Linux. This test environment can then be used for the rest of this chapter.
It is assumed the computer you will be using to run your test environment in has enough processing power and has hardware virtualization support (modern AMDs and Intel iX processors) with at least 4 GB RAM. Remember we're creating a virtual machine that itself will be used to spin up virtual machines, so the more RAM you have, the better.
Getting ready
To begin with, we must download VirtualBox from http://www.virtualbox.org/ and then follow the installation procedure once this has been downloaded.
We will also need to download the Ubuntu 12.04 LTS Server ISO CD-ROM image from http://www.ubuntu.com/.
Starting OpenStack Compute
8
# Create CD-Drive and Attach ISO VBoxManage storagectl openstack1 --name "IDE Controller" --add ide --controller PIIX4 --hostiocache on --bootable on VBoxManage storageattach openstack1 --storagectl "IDE Controller" --type dvddrive --port 0 --device 0 --medium Downloads/ubuntu- 12.04-server-amd64.iso
# Create and attach SATA Interface and Hard Drive VBoxManage storagectl openstack1 --name "SATA Controller" --add sata --controller IntelAHCI --hostiocache on --bootable on VBoxManage createhd --filename openstack1.vdi --size 20480 VBoxManage storageattach openstack1 --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium openstack1.vdi
auto eth iface eth0 inet dhcp
auto eth iface eth1 inet static address 172.16.0. netmask 255.255.0. network 172.16.0. broadcast 172.16.255.
Chapter 1
9
auto eth iface eth2 inet manual up ifconfig eth2 up
Remember to edit the /etc/network/interfaces file with root privileges.
sudo ifup eth sudo ifup eth
Congratulations! We have successfully created the VirtualBox virtual machine running Ubuntu, which is able to run OpenStack Compute.
How it works...
What we have done is created a virtual machine that is the basis of our OpenStack Compute host. It has the necessary networking in place to allow us to access this virtual machine from our host personal computer.
There's more...
There are a number of virtualization products available that are suitable for trying OpenStack, for example, VMware Server and VMware Player are equally suitable. With VirtualBox, you can also script your installations using a tool named Vagrant. While outside the scope of this book, the steps provided here allow you to investigate this option at a later date.
Now that we have a machine for running OpenStack, we can install the appropriate packages for running OpenStack Compute, which will allow us to spawn its own virtual machine instances.
To do this, we will create a machine that runs all the appropriate services for running OpenStack Nova. The services are as follows:
f nova-compute: The main package for running the virtual machine instances f nova-scheduler: The scheduler picks the server for fulfilling the request to run the instance