Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
OpenStack Cloud Computing Cookbook
OpenStack Cloud Computing Cookbook

OpenStack Cloud Computing Cookbook: Over 100 practical recipes to help you build and operate OpenStack cloud computing, storage, networking, and automation , Fourth Edition

Arrow left icon
Profile Icon Kevin Jackson Profile Icon Cody Bunch Profile Icon Egle Sigler Profile Icon James Denton
Arrow right icon
$9.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (10 Ratings)
eBook Jan 2018 398 pages 4th Edition
eBook
$9.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Kevin Jackson Profile Icon Cody Bunch Profile Icon Egle Sigler Profile Icon James Denton
Arrow right icon
$9.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (10 Ratings)
eBook Jan 2018 398 pages 4th Edition
eBook
$9.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$9.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

OpenStack Cloud Computing Cookbook

Chapter 2. The OpenStack Client

In this chapter, we will cover the following topics:

  • Introduction – using OpenStack

  • Installing Python on Windows

  • Installing the OpenStack clients

  • Configuring your Linux or macOS environment

  • Configuring your Windows environment

  • Common OpenStack networking tasks

  • Common OpenStack server (instances) tasks

  • Common OpenStack image tasks

  • Common OpenStack identity tasks

  • Common OpenStack storage tasks

  • Common OpenStack orchestration tasks

Introduction – using OpenStack


OpenStack can be interacted with in a number of ways – from using the Horizon (the OpenStack control panel) web interface to, the power of the command line to using third -party software, all of which are transparently integrated with OpenStack. In this chapter, we will introduce the OpenStack Command-Line Interface (CLI) and see how to configure it for use with your installation of OpenStack. The OpenStack command-line tools, like the vast majority of OpenStack, are written in Python. This means that there is a direct dependency on Python being available on the computer that will be running the clients.

When we interact with OpenStack, we are technically making REST API calls to the services that run the Service APIs (Application Programming Interfaces). A REST API defines a set of functions that developers can perform requests and receive responses via HTTP protocol such as GET and POST. The OpenStack command-line clients translate your intuitive commands...

Installing Python on Windows


In order to be able to install the required OpenStack client tools under Windows, we must first prepare our Windows desktop machine with Python. The following applies to Windows 10.

Getting ready

Ensure that you are logged into your desktop and have the following installed:

How to do it…

Configuring your Windows environment can be achieved from Properties of your PC. Follow these instructions to ensure that Python is available in your system path, as well as set the appropriate environment variables under PowerShell:

  1. Navigate to the This PC icon on your desktop and choose Properties, as shown here:

  2. Next, choose Advanced system settings from the menu on the left:

  3. Now, select Environment Variables from the Advanced tab of the System Properties window, as shown here:

  4. To set the path for Python, double-click on the Path entry as shown here...

Installing the OpenStack clients


There are a number of OpenStack clients available that are used to interact with OpenStack from the command line. Historically, each service in OpenStack has its own client. For example, the OpenStack Compute project, Nova, has its own nova client. Similarly, the OpenStack networking project, Neutron, also has its own client called neutron client. And so on.

Officially, there is a convergence to using one client: the OpenStack client. However, not all commands and features are available under this one tool. Moreover, the OpenStack client still requires each individual project command-line tool installed to function; however, it provides a more consistent interface without the need to remember each individual project name.

Getting ready

As we are preparing your desktop for interacting with OpenStack from the command line, you will appreciate that there are a variety of choices you can make for your desktop OS of choice. This section will describe the installation...

Configuring your Linux or macOS environment


The OpenStack tools are configured by setting environment variables in your shell or desktop.

Getting ready

Ensure that you have the OpenStack clients installed as described in the first recipe, Introduction – using OpenStack, in this chapter.

How to do it…

Configuration of your command-line environment is achieved by setting environment variables; however, it is easier and more convenient to place these variables in a file that we can later load into our environment. During the installation, OpenStack-Ansible creates a plain text file called openrc and places this in the /root directory of all the containers created. This file is a great starting point for configuring the environment as it has all the required elements needed to operate your CLI environment.

On your own client, for example, Linux or Mac-based, choose a working directory, such as $HOME/openstack, and create a file called openrc (or a meaningful name of your choice) with the following...

Configuring your Windows environment


Configuring your Windows environment for use with OpenStack requires a little more effort – but the basic premise remains: we're configuring our desktop so that it has access to environment variables, as well as ensuring that our tools, written in Python, are able to execute properly.

Getting ready

The following applies to Windows 10. Ensure that you have followed the steps to install Python.

How to do it…

Carry out the following to load the required environment variables into your Windows session:

  1. To be able to source in the required OpenStack environment functions as we do on a Unix/Linux platform, we can achieve a similar outcome using some PowerShell. In the PowerShell Terminal, go and grab the following PowerShell script and download it into your working client directory (for example C:\Users\Username\OpenStack):

    mkdir OpenStack
    cd OpenStack
    wget https://raw.githubusercontent.com/OpenStackCookbook/vagrant-openstack/master/Source-OpenRC.ps1 -UseBasicParsing...

Common OpenStack networking tasks


This section outlines common OpenStack networking tasks for quick reference only. For more details on using Neutron and how Neutron works – including details of when and where to use features such as Floating IPs and Routers, refer to Chapter 4, Neutron – OpenStack Networking.

Getting ready

Ensure that you have the OpenStack clients installed, as described in the first recipes in this chapter.

How to do it…

Carry out the following steps to create and modify networks in OpenStack:

Creating a network

There are usually two steps to create a network: creating the equivalent of an L2 network, followed by assigning a subnet (and details to it).

  1. First, create the network:

    openstack network create NETWORK_NAME
    
  2. Now create the subnet on this network:

    openstack subnet create SUBNET_NAME
        --network NETWORK_NAME--subnet-range CIDR
    
Creating a provider network (for use with Floating IPs)

To create a floating IP provider network, carry out the following commands. This command...

Common OpenStack server (instances) tasks


This section outlines a number of common commands that can be run when operating with instances (for example, virtual machines). For more detailed information and explanation of each task, refer to Chapter 5, Nova – OpenStack Compute.

Getting ready

Ensure that you have the OpenStack clients installed as described in the first recipes of this chapter.

How to do it…

Carry out the following to launch and manipulate running instances:

Launching an instance

To launch in an instance from the command line, you need the following information:

  • An image

  • A network

  • A flavor

  • An optional security group (default is used otherwise)

  • An optional key (if you intend to access the instance)

Carry out the following steps to launch an instance from the command line:

  1. First, list the images available:

    openstack image list
    
  2. Now we list the networks available (it will be the UUID of the Network we will use):

    openstack network list
    
  3. We need a flavor, if you need reminding of them, list them...

Common OpenStack image tasks


This section outlines a number of steps, intended as a quick overview only, when operating against the OpenStack Image service (known as Glance). For more detailed information and explanation of each task, refer to Chapter 6, Glance – OpenStack Image Service.

Getting ready

Ensure that you have the OpenStack clients installed, as described in the first recipes in this chapter.

How to do it…

Carry out the following steps to create and modify images in OpenStack:

Uploading an image to Glance

Uploading an image to OpenStack is achieved with the following. To upload, a QCOW2 image such as one provided by CirrOS for testing, carry out the following command:

openstack image create
    --container-type bare
    --disk-format qcow2
    --public
    --file
 /path/to/cirros-0.3.5-x86_64-disk.img

Downloading an image or snapshot from Glance as a file

To download an image from Glance, perhaps for copying to another environment or to store as an offsite backup, carry out the following...

Common OpenStack identity tasks


This section outlines a number of common steps to take for a number of common actions using the OpenStack Identity service. This is intended as a quick reference guide only. For more detailed information and explanation of each task, refer to Chapter 3, Keystone – OpenStack Identity Service.

Getting ready

Ensure that you have the OpenStack clients installed, as described in the first recipes of this chapter.

How to do it…

Carry out the following steps to create and modify users and projects in OpenStack:

Creating a new project

Creating a new user in a project is achieved with the following command. For example, to create the project called development, execute the following command:

openstack project create development

Creating a user

To create a user called developer, with a password of password123, carry out the following command:

openstack user create
    --domain default
    --password password123
    --enable
    developer

Adding a user to a project

To add a...

Common OpenStack storage tasks


This section outlines a number of common tasks using the OpenStack Block and Object Storage service. For more information on storage, refer to Chapter 7, Cinder – OpenStack Block Storage and Chapter 8, Swift – OpenStack Object Storage.

Getting ready

Ensure that you have the OpenStack clients installed, as described in the first recipes of this chapter.

How to do it…

Carry out the following steps to create and modify users and projects in OpenStack:

Create a new Cinder volume

To create a new Cinder block storage volume, carry out the following command. The size is in gigabytes:

openstack volume create --size 5 my5GVolume

Attaching a volume

To attach a volume to a running instance, carry out the following command. The running instance UUID is used and can be found by listing the running instances:

openstack server add volume my5GVolume 58ea640b-16ba-447c-85db-952174d70f7c

Detaching a volume

To detach a volume, first unmount it from the running instance as you would normally...

Common OpenStack orchestration tasks


This section outlines a number of common tasks using the OpenStack Orchestration (Heat) service to launch stacks (orchestrated environments using Heat). For more information on Heat and orchestration, refer to Chapter 9, OpenStack Orchestration Using Heat and Ansible.

Getting ready

Ensure that you have the OpenStack clients installed, as described in the first recipes of this chapter.

How to do it…

Carry out the following steps to create and use Heat templates in OpenStack to create orchestrated environments:

Launch a stack from a template and environment file

To launch a stack from a heat orchestration template (hot), issue the following command:

openstack stack create
    --template myStack.yml
    --environment myStack-Env.yml
    myStack

Listing stacks

To list the running stacks, issue the following command:

openstack stack list

Deleting a running stack

To destroy a running stack named myStack, issue the following command:

openstack stack delete myStack

Listing...

Left arrow icon Right arrow icon

Key benefits

  • • Over 100 recipes created by a team of OpenStack experts
  • • Updated to work with the latest OpenStack builds, with recipes covering the installation and use of OpenStack with Ansible
  • • It covers topics such as Keystone, Glance, Neutron, Nova, Cinder, and more, plus recipes for OpenStack storage, networking, and orchestrating workloads
  • • Test drive OpenStack using the accompanying Vagrant environment

Description

This is the fourth edition of the industry-acclaimed OpenStack Cloud Computing Cookbook, created by four recognized OpenStack experts. It has now been updated to work with the latest OpenStack builds, using tools and processes based on their collective and vast OpenStack experience. OpenStack Open Source Cloud software is one of the most used cloud infrastructures to support a wide variety of use cases, from software development to big data analysis. It is developed by a thriving community of individual developers from around the globe and backed by most of the leading players in the cloud space today. We make it simple to implement, massively scalable, and able to store a large pool of data and networking resources. OpenStack has a strong ecosystem that helps you provision your cloud storage needs. Add OpenStack's enterprise features to reduce the cost of your business. This book will begin by showing you the steps to build up an OpenStack private cloud environment using Ansible. You'll then discover the uses of cloud services such as the identity service, image service, and compute service. You'll dive into Neutron, the OpenStack Networking service, and get your hands dirty with configuring networks, routers, load balancers, and more. You’ll then gather more expert knowledge on OpenStack cloud computing by managing your cloud's security and migration. After that, we delve into OpenStack Object storage and you’ll see how to manage servers and work with objects, cluster, and storage functionalities. Finally, you will learn about OpenStack dashboard, Ansible, Keystone, and other interesting topics.

Who is this book for?

This book is written for cloud system engineers, system administrators, and technical architects who are moving from a virtualized environment to cloud environments. This book assumes that you are familiar with cloud computing platforms, and have knowledge of virtualization, networking, and managing Linux environments.

What you will learn

  • • Understand, install, configure, and manage a complete OpenStack Cloud platform using OpenStack-Ansible
  • • Configure networks, routers, load balancers, and more with Neutron
  • • Use Keystone to setup domains, roles, groups and user access
  • • Learn how to use Swift and setup container access control lists
  • • Gain hands-on experience and familiarity with Horizon, the OpenStack Dashboard user interface
  • • Automate complete solutions with our recipes on Heat, the OpenStack Orchestration service as well as using Ansible to orchestrate application workloads
  • • Follow practical advice and examples to run OpenStack in production

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 29, 2018
Length: 398 pages
Edition : 4th
Language : English
ISBN-13 : 9781788399333
Vendor :
OpenStack
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 29, 2018
Length: 398 pages
Edition : 4th
Language : English
ISBN-13 : 9781788399333
Vendor :
OpenStack
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 148.97
Mastering OpenStack
$49.99
OpenStack Cloud Computing Cookbook
$54.99
OpenStack for Architects
$43.99
Total $ 148.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Installing OpenStack with Ansible Chevron down icon Chevron up icon
The OpenStack Client Chevron down icon Chevron up icon
Keystone – OpenStack Identity Service Chevron down icon Chevron up icon
Neutron – OpenStack Networking Chevron down icon Chevron up icon
Nova – OpenStack Compute Chevron down icon Chevron up icon
Glance – OpenStack Image Service Chevron down icon Chevron up icon
Cinder – OpenStack Block Storage Chevron down icon Chevron up icon
Swift – OpenStack Object Storage Chevron down icon Chevron up icon
OpenStack Orchestration Using Heat and Ansible Chevron down icon Chevron up icon
Using OpenStack Dashboard Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(10 Ratings)
5 star 60%
4 star 20%
3 star 10%
2 star 10%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Saumik Satapathy Dec 04, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book to start openstack. Step by strp guide to learn and master over openstack.
Amazon Verified review Amazon
Rebecca Fitzhugh Mar 03, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Regardless of whether you are a beginner or experienced with OpenStack, this book provides a plethora of information. It provides information from high level architectural decision making assistance to Ansible code. It is an excellent all-around guide that explores all facts of OpenStack. Recommend adding it to your bookshelf!
Amazon Verified review Amazon
Paolo Correnti Nov 23, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Per avere un'idea di base di cosa sia Openstack
Amazon Verified review Amazon
Stephen Beaver Feb 20, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
OpenStack Cloud Computing Cookbook is a solid guide for anyone that is starting out as well as a quick reference guide for the seasoned administrator. Whether you are just starting out and are looking for a step by step guide from deployment to operations or a reference point on a specific topic. This cookbook will be a great addition to your technical library for information all about OpenStack.
Amazon Verified review Amazon
Stefan Lenz May 21, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The cookbook always was a great resource to learn about the basics of Openstack and to set up ones own clusters. While the earlier editions were limited with respect to network topologies and production cluster setup, the new, fourth editions has made a big step forward. The presented network topology and setup recipes of the cookbook are "production grade". You learn how to build your own small production cluster that can be used for learning but also to test real workloads. Kudos to the writers for this new edition.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.