OpenStack Bootcamp

5 (1 reviews total)
By Vinoth Kumar Selvaraj
  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Day 1 - Build Your Camp

About this book

OpenStack is developed by a thriving community of individual developers around the globe and is backed by most of the leading players in the cloud space today. OpenStack is a free and open source software platform for cloud computing, mostly deployed as an infrastructure-as-a-service (IaaS).

This book begins with the design principles of OpenStack and the available OpenStack distributions. You’ll start by getting a fundamental understanding of the core concepts and then move on to a comparison of OpenStack components with real-life examples. Then, we’ll show you the typical architecture of OpenStack clouds, how to configure each OpenStack component, and debugging techniques.

Later, we focus on the latest releases of OpenStack: Mikata, Newton, and Ocata. You’ll be introduced to identity, image, networking, and the compute service. You’ll also get a complete understanding of how to install, configure, and administrate your entire virtual private cloud. You will also be provided with hands-on exercises to unleash the power of each component in OpenStack. Finally, you’ll see an overview of all the optional projects available under the Openstack umbrella.

Publication date:
November 2017
Publisher
Packt
Pages
302
ISBN
9781788293303

 

Chapter 1. Day 1 - Build Your Camp

OpenStack has a very complex architectural design to understand theoretically. I firmly believe that a hands-on experience with OpenStack will help you to understand the OpenStack design a lot better than just reading through the details.

To unleash the power of learning by doing, I purposely chose to deal with this OpenStack setup and installation chapter first. Though this section will deal with the script-based OpenStack installation, using DevStack to help you learn OpenStack design by having practical hands-on experience with OpenStack, once you have a complete understanding of the OpenStack modular design, Chapter 8, Day 8 - Build Your OpenStack, will guide the users through an actual step-by-step customized installation of OpenStack.

As the book title implies, the bootcamp series is a new concept that is targeted at someone who is looking for absolute knowledge of OpenStack without wasting time by learning ABC on day 1 and XYZ on day 2. So, I focused more on hands-on exercises for the readers instead of starting with the history and evolution of OpenStack.

 

Design principles for OpenStack


OpenStack has a modular design, and most of the OpenStack projects and services are capable of being used independently. At a high level, OpenStack services are categorized as core services and optional services. As the name states, the core services have the essential functionality of providing IAAS features for OpenStack. The optional services are like the bells and whistles of OpenStack, which provide the extended functionality for the IAAS platform.

The following listed services are the core components of OpenStack:

  • Keystone (identity service)
  • Glance (image service)
  • Nova (compute service)
  • Neutron (networking service)

The following listed services are the optional components of OpenStack:

  • Cinder (block storage service)
  • Horizon (Dashboard)
  • Swift (object storage service)
  • Other 20+ projects

We will discuss all the essential components of OpenStack briefly in Chapter 2, Day 2 - Know Your Battalion.

 

OpenStack distributions


Before we start building our play camp, it would be good to know about some of the familiar OpenStack distributions available, which are as follows:

  • Ubuntu OpenStack
  • RedHat OpenStack Platform
  • SUSE OpenStack Cloud
  • Debian OpenStack
  • Mirantis OpenStack
  • VMware Integrated OpenStack
  • Hyper-C
  • HPE Helion OpenStack®
  • Oracle OpenStack
  • Stratoscale
  • IBM Cloud Manager with OpenStack and the list goes on

Don't get confuse the these enterprise distributions of OpenStack with the open source release. The preceding distributions are the enterprise editions of OpenStack with a fully integrated, optimized combination for their selected platforms.

 

Vanilla OpenStack


Vanilla OpenStack generally refers to an OpenStack without any special optimization, which is free and open source, and available at https://docs.openstack.org/.

We will look at the step-by-step installation procedure of OpenStack in Chapter 8, Day 8 - Build Your OpenStack after understanding the OpenStack design completely.

As of now, to build our play camp, we will be using the automated, opinionated script to create an OpenStack development environment quickly. There are various options available to build the OpenStack development environment in one go, such as:

  • DevStack: For Ubuntu (recommended)
  • PackStack: For CentOS/RHEL

There are also plenty of volunteer scripts available online to install OpenStack quickly with one command.

In this chapter, we will be focusing on the DevStack installation to bring up our play camp to get hands-on with the OpenStack cloud.

 

DevStack installation


This guide assumes that you have access to a virtual machine that has a Ubuntu 16.04 LTS operating system installed with a minimum of 6 GB RAM and 30 GB HDD.

Downloading and installing the virtual box and creating new virtual machine is not in the scope of this book. There are lots of free tutorials available online for creating your new virtual machine with the aforementioned specifications.

Prepare your virtual machine

To demonstrate a simple working OpenStack cloud using DevStack, you must have the following requirements configured in the VirtualBox environment to start the DevStack installation:

  • Ubuntu 16.04 LTS operating system
  • 6 GB RAM
  • 40 GB disk space
  • 2 vCPUs
  • 2 NIC (Adapter 1 - NAT network and Adapter 2 - host-only network)

Adding the second adapter to the operating system requires manual configuration changes in the network interface file. Make sure you have added the second interface with DHCP settings in the /etc/network/interfaces file, and that both NICs have obtained the IP address.

Then perform an apt-get update and a dist-upgrade and reboot the machine.

Let's DevStack

Log in to your Ubuntu virtual machine and go through the following steps to complete the prerequisites for installing DevStack.

  1. Verify the IP address using the following command:
$ ifconfig

You will get the following output:

 

You can see from the output that the IP address is assigned for both enp0s3and enp0s8 adapters. If you are using the virtual box for the first time, the default IP value will be 10.0.2.x for the NAT network and 192.168.56.x for the host-only network.

  1. Let's add a stack user. DevStack should be run as a sudo user, but not as root, so create a sudo user named stack to run the DevStack installation for building your camp:
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
  1. Let's add the stack user to the sudoers. The following command will add the stack user to the sudoers list:
$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee
        /etc/sudoers.d/stack
  1. Now log in as a stack user and verify that you have appropriate sudo privileges:
$ sudo su - stack
        $ sudo id

At this stage, if the shell is prompted for a password, which means that the sudo privileges for the stack user are not configured correctly, ensure that you have followed step 2 and step 3 correctly.

  1. Let's download DevStack:
$ sudo apt-get install -y git-core

Note

At this stage, you will not be prompted for any password.

The following command will download the DevStack repository into your local machine:

$ git clone https://git.openstack.org/openstack-dev/devstack -b
        stable/ocata

Note

The preceding command will download the stable version of DevStack repository to install OpenStack ocata release. Optionally, you may replace ocata with any latest release of OpenStack code name in the preceding command to install the latest OpenStack release.

The downloaded DevStack repository contains the automated script that installs OpenStack and templates for configuration files. Make sure you have working internet connectivity before executing the preceding command:

  1. Let's configure DevStack. The downloaded DevStack repository comes with the sample configuration file. By adding a few additional parameters to the sample configuration file, we could use it as an actual configuration file for our default DevStack installation to build our play camp with. The following commands will create a configuration file suitable for our DevStack installation:
$ cd devstack$ git checkout stable/ocata$ cp samples/local.conf .$ HOST_IP="192.168.56.101"$ echo "HOST_IP=${HOST_IP}" >> local.conf

In the preceding command, 192.168.56.101 is the IP address of my host-only adapter enp0s8. If your machine has a different IP address, you should replace the IP address with your host-only adapter's IP address.

Before proceeding further, it would be useful if you go through your local.conf environment file. For your convenience, you could also change the hard-coded admin and database passwords in the local.conf file.

  1. Let's begin the installation. Make sure you are running the following command inside the devstack folder:
$ ./stack.sh

At this stage, the actual installation of DevStack will begin and will take approximately 20-30 minutes to complete depending on your internet speed and the hardware that you are using.

  1. Eureka! On successful installation, you will see an output similar to the following figure:

  1. Kudos! Now you have a working OpenStack cloud. To get a hands-on experience with it, you can access your OpenStack cloud in two ways:
    • Openstack web UI (Horizon): Access the Openstack Horizon via your host machine's browser with the URL and password displayed in your DevStack installation terminal output. In my case, I access my OpenStack UI at http://192.168.56.101/dashboard/ and the password for the admin user is nomoresecret:

Note

The host-only network allows all the traffic to flow between the virtual machine and the host machine (a laptop in my case). To access your OpenStack services from computers other than your host computer, you can optionally enable the third network adaptor with the bridged adapter network type option in the VirtualBox settings.

  • Openstack command-line tool: Optionally, you can access the source openrc file in your terminal and use the OpenStack command lines to manage your OpenStack cloud. The openrc file will be created inside the devstack folder after the DevStack installation:
  1. You should be aware of the following useful DevStack commands that could help you save your valuable time:
    • Reconnect to DevStack by rerunning the installation whenever you reboot your virtual machine using the following command:
$ ./stack.sh
  • To stop all the OpenStack services started by ./stack.sh, use the following command:
$ ./unstack.sh
  • To remove all the DevStack data files from your VM, use the following command:
$ ./clean.sh
 

OpenStack community and getting help


The essence of the open source ethos and the community-driven development approach has established OpenStack as one of the fastest-growing and active open source communities in the world. So, whenever you get stuck with any issues in OpenStack, you can make use of this big, global, open-source community.

You can connect to the OpenStack community in order to get assistance in the following ways:

I would strongly recommend that all OpenStack beginners register with the https://ask.openstack.org/ forum to get started with OpenStack.

 

Summary


On day 1, we have successfully built our bootcamp using the DevStack scripted installation. Now we have our OpenStack cloud lab up and running to get some hands-on experience in OpenStack. Like I mentioned before, we have various options that are available for us to build the OpenStack development environment in one go. In this book, I have chosen to go with DevStack to build the OpenStack play camp. Alternatively, you could try some of the different options that are available to make your OpenStack play field. Irrespective of your choice, the final output will be the same OpenStack.

We also learned about the design principle of OpenStack and the distributions that are available.

On day 2, we will walk through the overview of OpenStack's core components in detail and make some real-world comparisons.

 

About the Author

  • Vinoth Kumar Selvaraj

    Vinoth Kumar Selvaraj is an enthusiastic computer science engineer from Tamil Nadu, India. He works as a DevOps engineer at Cloudenablers Inc. As an active moderator on Ask OpenStack, he consistently answers and provides solutions for questions posted on the Ask OpenStack forum. Based on karma points, he has ranked 20 out of 20,000 members in the Ask OpenStack forum. He has also written many OpenStack-related articles and hosts a dedicated website for his works on OpenStack.

    Vinoth has also worked as a technical reviewer on books by Packt such as Openstack Cloud Security, Learning OpenStack High Availability, Openstack Essentials, and Learning OpenStack [Video].

    Browse publications by this author

Latest Reviews

(1 reviews total)
Fast and easy. I got my books right away . I can start to read

Recommended For You

OpenStack for Architects - Second Edition

Implement successful private clouds with OpenStack

By Ben Silverman and 1 more
Learning OpenStack Networking - Third Edition

Discover the basics of virtual networking in OpenStack to implement various cloud network architectures

By James Denton
OpenStack Cloud Computing Cookbook - Fourth Edition

The Fourth Edition of the industry-acclaimed OpenStack Cloud Computing Cookbook, from four recognized experts, updated to the latest OpenStack build including Cinder, Nova, and Neutron.

By Kevin Jackson and 3 more
Mastering Ansible - Third Edition

Design, develop, and solve real-world automation and orchestration problems by unlocking the automation capabilities of Ansible.

By James Freeman and 1 more