O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

OpenStack Administration with Ansible

Book Description

Design, build, and automate 10 real-world OpenStack administrative tasks with Ansible

About This Book

  • Automate real-world OpenStack cloud operator administrative tasks
  • Construct a collection of automation code to save time on managing your OpenStack cloud
  • Use this step-by-step tutorial to automate such tasks with Ansible

Who This Book Is For

If you are an OpenStack-based cloud operator and/or infrastructure administrator and are interested in automating administrative functions, then this book is exactly what you are looking for. Having a functioning OpenStack environment is helpful, but most certainly not necessary.

What You Will Learn

  • Efficiently execute OpenStack administrative tasks
  • Familiarize yourself with how Ansible works and assess the defined best practices
  • Create Ansible playbooks and roles
  • Automate tasks to customize your OpenStack cloud
  • Review OpenStack automation considerations when automating administrative tasks
  • Examine and automate advanced OpenStack tasks and designated use cases
  • Get a high-level overview of OpenStack and the current production-ready projects
  • Deep dive into OpenStack CLI tools and find out how to use them

In Detail

Most organizations are seeking methods to improve business agility because they have realized just having a cloud is not enough. Being able to improve application deployments, reduce infrastructure downtime, and eliminate daily manual tasks can only be accomplished through some sort of automation.

Packed with real-world OpenStack administrative tasks, this book will walk you through working examples and explain how these tasks can be automated using one of the most popular open source automation tools—Ansible.

We will start with a brief overview of OpenStack and Ansible and highlight some best practices. Each chapter will provide an introduction to handling various Cloud Operator administration tasks such as creating multiple users/tenants, setting up Multi-Tenant Isolation, customizing your clouds quotas, taking instance snapshots, evacuating compute hosts for maintenance, and running cloud health checks, and a step-by-step tutorial on how to automate these tasks with Ansible.

Style and approach

This easy-to-follow reference guide is packed with examples of real-world OpenStack administration tasks; each task is explained in detail and then subsequently turned into automation code.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. OpenStack Administration with Ansible
    1. Table of Contents
    2. OpenStack Administration with Ansible
    3. Credits
    4. About the Author
    5. Acknowledgments
    6. About the Reviewer
    7. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    8. 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. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    9. 1. An Introduction to OpenStack
      1. OpenStack overview
        1. The OpenStack foundation
      2. Reviewing the OpenStack services
        1. OpenStack Compute (codename Nova)
        2. OpenStack Object Storage (codename Swift)
        3. OpenStack Image Service (codename Glance)
        4. OpenStack Identity (codename Keystone)
        5. OpenStack Dashboard (codename Horizon)
        6. OpenStack Networking (codename Neutron)
        7. OpenStack Block Storage (codename Cinder)
        8. OpenStack Orchestration (codename Heat)
        9. OpenStack Telemetry (codename Ceilometer)
        10. OpenStack Database (codename Trove)
        11. OpenStack Data Processing (codename Sahara)
        12. OpenStack Bare Metal Provisioning (codename Ironic)
      3. OpenStack supporting components
      4. Features and benefits
        1. Fully distributed architecture
        2. Uses commodity hardware
        3. Scale horizontally or vertically
        4. Meets high availability requirements
        5. Compute isolation and multi-DC support
        6. Robust role-based access control
      5. Working examples – list the services and endpoints
        1. Listing the OpenStack services
          1. Via API
          2. Via CLI
        2. Listing the OpenStack endpoints
          1. Via API
          2. Via CLI
      6. Summary
    10. 2. An Introduction to Ansible
      1. Ansible overview
      2. What are playbooks, roles, and modules?
        1. Playbooks
        2. Roles
        3. Modules
      3. Variables and facts
        1. Variables
          1. Setting variable placeholders
          2. Defining variable values
          3. Registering variables
        2. Facts
      4. Defining the inventory
        1. Dynamic inventory
      5. Summary
    11. 3. Creating Multiple Users/Tenants
      1. Creating users and tenants
        1. Manually creating users and tenants
          1. Creating a user
          2. Creating a tenant
          3. Assigning users role and tenant access
      2. Automation considerations
        1. Defining variables globally or per role
        2. The OpenStack API or CLI
        3. Where to run Ansible
      3. Coding the playbook and roles
      4. The playbook and role review
      5. Summary
    12. 4. Customizing Your Cloud's Quotas
      1. Define and create quotas
        1. Creating quotas manually
        2. Setting up default quotas
        3. Reset quota values
      2. Automation considerations
      3. Coding the playbook and roles
      4. Playbook and role review
      5. Summary
    13. 5. Snapshot Your Cloud
      1. Define backups and snapshots
        1. Creating backups and snapshots manually
        2. Restore an instance backup
      2. Automation considerations
      3. Coding the playbook and roles
      4. Playbook and role review
      5. Summary
    14. 6. Migrating Instances
      1. Instance migration
        1. Manually migrating instances
        2. Migrating an instance to a specific compute node
      2. Automation considerations
      3. Coding the playbook and roles
      4. Playbook and role review
      5. Summary
    15. 7. Setting up Isolated Tenants
      1. Multi-tenant isolation explained
      2. Setting up multi-tenant isolation
        1. Pre-configuration steps
          1. Step 1
          2. Step 2
        2. Tenant configuration steps
          1. Step 1 – create a new or use an existing tenant
          2. Step 2 – create new host aggregate
          3. Step 3 – add hosts to the new host aggregate
          4. Step 4 – update host aggregate metadata
          5. Step 5 – create a custom flavor to include the tenant filter
          6. Step 6 – apply volume type quotas
      3. Automation considerations
      4. Coding the playbook and roles
      5. Playbook and role review
      6. Summary
    16. 8. Deploying OpenStack Features
      1. Multiple hypervisor support
      2. What is Docker (aka Docker Engine)?
      3. Setting up Docker and nova-docker
        1. Docker configuration
          1. Install Docker on a new compute node
        2. Configuring nova-docker
          1. Step 1 – install nova-docker
          2. Step 2 – update the Nova compute_driver parameter
          3. Step 3 – add the docker.filters file to the Nova rootwrap.d folder
          4. Step 4 – add and remove filters on the compute node(s) Nova scheduler
          5. Step 5 – add and remove filters on the controller node(s) Nova scheduler
          6. Step 6 – create a custom Docker flavor with extra specs
          7. Step 7 – create a new host aggregate for the Docker compute node(s)
          8. Step 8 – add docker to the Glance API container_formats
      4. Coding the playbook and roles
        1. Install Docker
        2. nova-docker
        3. nova-update
        4. openstack-config
        5. nova-scheduler
        6. glance-update
      5. Playbook and role review
      6. Summary
    17. 9. Inventory Your Cloud
      1. Collecting cloud metrics
        1. User report
        2. Tenant report
        3. Network report
        4. Volume report
        5. Cloud-at-a-glance report
      2. Coding the playbook and roles
        1. cloud-inventory
        2. cloud-usage
        3. user-inventory
        4. tenant-inventory
        5. network-inventory
        6. volume-inventory
      3. Playbook and role review
      4. Summary
    18. 10. Health Check Your Cloud
      1. Monitoring the cloud
        1. OpenStack service processes
        2. Infrastructure services
          1. MariaDB and Galera
          2. RabbitMQ
      2. Core OpenStack services
        1. Service and process check examples
      3. Coding the playbook and roles
        1. cloud-infra-check
        2. cloud-core-os-check
        3. os-service-status
      4. Playbook and role review
      5. Summary
    19. Index