You are previewing OpenStack Cloud Computing Cookbook Second Edition.
O'Reilly logo
OpenStack Cloud Computing Cookbook Second Edition

Book Description

Over 100 recipes to successfully set up and manage your OpenStack cloud environments with complete coverage of Nova, Swift, Keystone, Glance, Horizon, Neutron, and Cinder

  • Updated for OpenStack Grizzly

  • Learn how to install, configure, and manage all of the OpenStack core projects including new topics like block storage and software defined networking

  • Learn how to build your Private Cloud utilizing DevOps and Continuous Integration tools and techniques

  • In Detail

    OpenStack is an open source cloud operating stack that was born from Rackspace and NASA and became a global success, developed by scores of people around the globe and backed by some of the leading players in the cloud space today.

    OpenStack Cloud Computing Cookbook, Second Edition will show you exactly how to install the components that are required to make up a private cloud environment. You will learn how to set up an environment that you manage just as you would a public cloud provider like Rackspace with the help of experienced OpenStack administrators and architects.

    We begin by configuring the key components such as identity, image compute, and storage in a safe, virtual environment that we will then build on this throughout the book. The book will also teach you about provisioning and managing OpenStack in the datacenter using proven DevOps tools and techniques.

    From installing or creating a sandbox environment using Vagrant and VirtualBox to installing OpenStack in the datacenter, from understanding logging to automating OpenStack installations, whatever level of experience or interest you have with OpenStack there is a chapter for you. Installation steps cover compute, object storage, identity, block storage volumes, image, horizon, software defined networking and DevOps tools for automating your infrastructure OpenStack Cloud Computing Cookbook, Second edition gives you clear step-by-step instructions to installing and running your own private cloud.

    Table of Contents

    1. OpenStack Cloud Computing Cookbook Second Edition
      1. Table of Contents
      2. OpenStack Cloud Computing Cookbook Second Edition
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Keystone OpenStack Identity Service
        1. Introduction
        2. Creating a sandbox environment using VirtualBox and Vagrant
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Configuring Ubuntu Cloud archive
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Using an alternative release
        4. Installing OpenStack Identity service
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating tenants
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Configuring roles
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Adding users
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Defining service endpoints
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Creating the service tenant and service users
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 2. Starting OpenStack Image Service
        1. Introduction
        2. Installing OpenStack Image Service
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Using an alternative release
          5. See also
        3. Configuring OpenStack Image Service with MySQL
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Configuring OpenStack Image Service with OpenStack Identity Service
          1. Getting Ready
          2. How to do it...
          3. How it works...
        5. Managing images with OpenStack Image Service
          1. Getting ready
          2. How to do it...
            1. Uploading Ubuntu images
            2. Listing images
            3. Viewing image details
            4. Deleting images
            5. Making private images public
          3. How it works
        6. Registering a remotely stored image
          1. Getting ready
          2. How to do it...
          3. How it works
        7. Sharing images among tenants
          1. Getting ready
          2. How to do it...
          3. How it works
        8. Viewing shared images
          1. Getting ready
          2. How to do it...
          3. How it works
      10. 3. Starting OpenStack Compute
        1. Introduction
        2. Installing OpenStack Compute Controller services
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a sandbox Compute server with VirtualBox and Vagrant
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Installing OpenStack Compute packages
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Using an alternative release
        5. Configuring database services
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Configuring OpenStack Compute
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Information online regarding flags
        7. Configuring OpenStack Compute with OpenStack Identity Service
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Stopping and starting Nova services
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Installation of command-line tools on Ubuntu
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Checking OpenStack Compute services
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Using OpenStack Compute
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Managing security groups
          1. Getting ready
          2. How to do it...
            1. Creating security groups
            2. Removing a rule from a security group
            3. Deleting a security group
          3. How it works...
            1. Defining groups and rules using Nova Client
        13. Creating and managing keypairs
          1. Getting ready
          2. How to do it...
            1. Listing and deleting keypairs using Nova Client
              1. Listing the keypairs
              2. Deleting the keypairs
          3. How it works...
        14. Launching our first Cloud instance
          1. Getting ready
          2. How to do it...
          3. How it works...
        15. Terminating your instance
          1. How to do it...
          2. How it works...
      11. 4. Installing OpenStack Object Storage
        1. Introduction
        2. Creating an OpenStack Object Storage sandbox environment
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Installing OpenStack Object Storage
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Configuring storage
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Configuring replication
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Configuring OpenStack Object Storage Service
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Configuring OpenStack Object Storage proxy server
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Configuring Account Server
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Configuring Container Server
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Configuring Object Server
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Making rings
          1. Getting ready
          2. How to do it...
          3. How it works
        12. Stopping and starting OpenStack Object Storage
          1. Getting ready
          2. How to do it...
          3. How it works...
        13. Configuring OpenStack Object Storage with OpenStack Identity Service
          1. Getting ready
          2. How to do it...
          3. How it works...
        14. Setting up SSL access
          1. Getting ready
          2. How to do it...
          3. How it works...
        15. Testing OpenStack Object Storage
          1. Getting ready
          2. How to do it...
            1. Using a swift command to test OpenStack Object Storage
          3. How it works...
      12. 5. Using OpenStack Object Storage
        1. Introduction
        2. Installing the swift client tool
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Creating containers
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Uploading objects
          1. Getting ready
          2. How to do it...
            1. Uploading objects
            2. Uploading directories
            3. Uploading multiple objects
          3. How it works...
        5. Uploading large objects
          1. Getting ready
          2. How to do it...
            1. Uploading objects
          3. How it works...
        6. Listing containers and objects
          1. Getting ready
          2. How to do it...
            1. Listing all objects in a container
            2. Listing specific object paths within a container
          3. How it works...
        7. Downloading objects
          1. Getting ready
          2. How to do it...
            1. Downloading objects
            2. Downloading objects with the -o parameter
            3. Downloading all objects from a container
            4. Downloading all objects from our OpenStack Object Storage account
          3. How it works...
        8. Deleting containers and objects
          1. Getting ready
          2. How to do it...
            1. Deleting objects
            2. Deleting multiple objects
            3. Deleting containers
            4. Deleting everything from our account
          3. How it works...
        9. Using OpenStack Object Storage ACLs
          1. Getting ready
          2. How to do it...
          3. How it works...
      13. 6. Administering OpenStack Object Storage
        1. Introduction
        2. Preparing drives for OpenStack Object Storage
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Managing OpenStack Object Storage cluster with swift-init
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Checking cluster health
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Benchmarking OpenStack Object Storage
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Managing swift cluster capacity
          1. Getting ready
          2. How to do it...
            1. Proxy Server
            2. Storage Node
          3. How it works...
        7. Removing nodes from a cluster
          1. Getting ready
          2. How to do it...
            1. Proxy Server
          3. How it works...
        8. Detecting and replacing failed hard drives
          1. Getting ready
          2. How to do it...
            1. Storage node
          3. How it works...
        9. Collecting usage statistics
          1. Getting ready
          2. How to do it...
            1. Disk usage
            2. Load average
            3. Quarantined statistics
            4. Check replication metrics
          3. How it works...
      14. 7. Starting OpenStack Block Storage
        1. Introduction
        2. Configuring Cinder volume services
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Configuring OpenStack Compute for Cinder volume
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Creating volumes
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Attaching volumes to an instance
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Detaching volumes from an instance
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Deleting volumes
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 8. OpenStack Networking
        1. Introduction
        2. Configuring Flat networking with DHCP
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Configuring VLAN Manager networking
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Configuring per tenant IP ranges for VLAN Manager
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Automatically assigning fixed networks to tenants
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Modifying a tenant's fixed network
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Manually associating floating IPs to instances
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Manually disassociating floating IPs from instances
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Automatically assigning floating IPs
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Creating a sandbox Network server for Neutron with VirtualBox and Vagrant
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Installing and configuring OVS for Neutron
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Installing and configuring the Neutron API server
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Neutron:
        13. Configuring Compute nodes for Neutron
          1. Getting ready
          2. How to do it...
          3. How it works...
        14. Creating a Neutron network
          1. Getting ready
          2. How to do it...
          3. How it works...
        15. Deleting a Neutron network
          1. Getting ready
          2. How to do it...
          3. How it works...
        16. Creating an external Neutron network
          1. Getting ready
          2. How to do it...
          3. How it works...
      16. 9. Using OpenStack Dashboard
        1. Introduction
        2. Installing OpenStack Dashboard
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using OpenStack Dashboard for key management
          1. Getting ready
          2. How to do it...
            1. Adding keypairs
            2. Deleting keypairs
            3. Importing keypairs
          3. How it works...
        4. Using OpenStack Dashboard to manage Neutron networks
          1. Getting ready
          2. How to do it...
            1. Creating networks
            2. Deleting networks
            3. Viewing networks
          3. How it works...
        5. Using OpenStack Dashboard for security group management
          1. Getting ready
          2. How to do it...
            1. Creating a security group
            2. Editing security groups to add and remove rules
            3. Deleting security groups
          3. How it works...
        6. Using OpenStack Dashboard to launch instances
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Using OpenStack Dashboard to terminate instances
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Using OpenStack Dashboard for connecting to instances using VNC
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Using OpenStack Dashboard to add new tenants
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Using OpenStack Dashboard for user management
          1. Getting ready
          2. How to do it...
            1. Adding users
            2. Deleting users
            3. Updating user details and passwords
            4. Adding users to tenants
            5. Removing users from tenants
          3. How it works...
      17. 10. Automating OpenStack Installations
        1. Introduction
        2. Installing Opscode Chef Server
          1. Getting ready
          2. How to do it…
          3. How it works...
        3. Installing Chef Client
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Downloading cookbooks to support DHCP, Razor, and OpenStack
          1. Getting started
          2. How to do it...
          3. How it works…
        5. Installing PuppetLabs Razor and DHCP from cookbooks
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Setting up a Chef environment for OpenStack
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Booting the first OpenStack node into Razor
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Defining a Razor broker, model, and policy
          1. Getting ready
          2. How to do it...
            1. Adding a Razor model
            2. Adding a Razor broker
            3. Adding a Razor policy
          3. How it works...
        9. Monitoring the node installation
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Using Chef to install OpenStack
          1. Getting ready
          2. How to do it...
          3. How it works…
        11. Expanding our OpenStack environment
          1. Getting ready
          2. How to do it...
          3. How it works…
      18. 11. Highly Available OpenStack
        1. Introduction
        2. Using Galera for MySQL clustering
          1. Getting ready
          2. How to do it...
            1. Configuring MySQL and Galera
            2. Node preparation
            3. Installation
            4. Configuration of database cluster for OpenStack
          3. How it works...
        3. Configuring HA Proxy for MySQL Galera load balancing
          1. Getting ready
          2. How to do it...
            1. Installation of HA Proxy for MySQL
            2. OpenStack configuration using floating IP address
          3. How it works...
        4. Installing and setting up Pacemaker and Corosync
          1. Getting ready
          2. How to do it...
            1. First node (controller1)
            2. Second node (controller2)
            3. First node (controller1)
            4. Second node (controller2)
            5. Starting the Pacemaker and Corosync services
          3. How it works...
        5. Configuring Keystone and Glance with Pacemaker and Corosync
          1. Getting ready
          2. How to do it...
            1. Glance across 2 nodes with FloatingIP
            2. Configuring Pacemaker for use with Glance and Keystone
          3. How it works...
        6. Bonding network interfaces for redundancy
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      19. 12. Troubleshooting
        1. Introduction
        2. Understanding logging
          1. Getting ready
          2. How to do it...
            1. OpenStack Compute services logs
            2. OpenStack Dashboard logs
            3. OpenStack Storage logs
            4. OpenStack Identity logs
            5. OpenStack Image Service logs
            6. OpenStack Network Service logs
            7. Changing log levels
              1. Log-level settings in OpenStack Compute services
              2. Log-level settings in other OpenStack services
          3. How it works...
        3. Checking OpenStack services
          1. Getting ready
          2. How to do it...
            1. Checking OpenStack Compute Services
            2. OpenStack Image Service (Glance)
            3. Other services that you should check
            4. Checking OpenStack Dashboard (Horizon)
            5. Checking OpenStack Identity (Keystone)
            6. Checking OpenStack Networking (Neutron)
            7. Checking OpenStack Block Storage (Cinder)
            8. Checking OpenStack Object Storage (Swift)
          3. How it works...
        4. Troubleshooting OpenStack Compute services
          1. How to do it...
            1. Steps for when you cannot ping or SSH to an instance
            2. Methods for viewing the Instance Console log
            3. Instance fails to download meta information
            4. Instance launches; stuck at Building or Pending
            5. Error codes such as 401, 403, 500
            6. Listing all instances across all hosts
          2. How it works...
        5. Troubleshooting OpenStack Object Storage services
          1. How to do it...
            1. Authentication issues
            2. Handling drive failure
            3. Handling server failure and reboots
          2. How it works...
        6. Troubleshooting OpenStack Dashboard
          1. How to do it…
            1. Unable to log into the OpenStack Dashboard
          2. How it works…
        7. Troubleshooting OpenStack Authentication
          1. Getting ready
          2. How to do it...
            1. Misconfigured endpoints
            2. Authentication issues
          3. How it works...
        8. Troubleshooting OpenStack Networking
          1. Getting ready
          2. How to do it...
            1. Cloud-init reporting Connection Refused when accessing Metadata
        9. Submitting Bug reports
          1. How to do it...
            1. Creating an account on LaunchPad
            2. Submitting bug reports through LaunchPad
            3. Useful commands to help complete a bug report
            4. Pasting logs
          2. How it works...
          3. See also
        10. Getting help from the community
          1. How to do it...
            1. IRC support
            2. Mailing list
            3. Pasting logs
          2. How it works...
          3. See also
      20. 13. Monitoring
        1. Introduction
        2. Monitoring OpenStack services with Nagios
          1. Getting ready
          2. How to do it...
            1. Nagios server
            2. Configuring NRPE on Nodes
            3. On the Controller server
            4. On the Computer server
            5. For Swift
            6. Remaining OpenStack Services
            7. Configuring Nagios to monitor OpenStack Nodes
          3. How it works...
          4. See also
        3. Monitoring Compute services with Munin
          1. Getting ready
          2. How to do it...
            1. Munin master server
            2. Munin nodes
            3. Monitoring OpenStack Compute services
          3. How it works...
        4. Monitoring instances using Munin and Collectd
          1. How to do it...
            1. Munin
            2. Collectd
              1. Collectd server
              2. Collectd Client
              3. Collectd-web
          2. How it works...
        5. Monitoring the storage service using StatsD/Graphite
          1. Getting ready
          2. How to do it...
            1. Prerequisites
            2. Graphite
            3. StatsD
            4. swift-informant
          3. How it works...
          4. See also
        6. Monitoring MySQL with Hyperic
          1. Getting ready
          2. How to do it...
            1. Hyperic server
            2. Nodes
            3. Monitoring MySQL
          3. How it works...
          4. There's more...
      21. Index