OpenStack Administration with Ansible
Table of Contents
OpenStack Administration with Ansible
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. An Introduction to OpenStack
OpenStack overview
The OpenStack foundation
Reviewing the OpenStack services
OpenStack Compute (codename Nova)
OpenStack Object Storage (codename Swift)
OpenStack Image Service (codename Glance)
OpenStack Identity (codename Keystone)
OpenStack Dashboard (codename Horizon)
OpenStack Networking (codename Neutron)
OpenStack Block Storage (codename Cinder)
OpenStack Orchestration (codename Heat)
OpenStack Telemetry (codename Ceilometer)
OpenStack Database (codename Trove)
OpenStack Data Processing (codename Sahara)
OpenStack Bare Metal Provisioning (codename Ironic)
OpenStack supporting components
Features and benefits
Fully distributed architecture
Uses commodity hardware
Scale horizontally or vertically
Meets high availability requirements
Compute isolation and multi-DC support
Robust role-based access control
Working examples – list the services and endpoints
Listing the OpenStack services
Via API
Via CLI
Listing the OpenStack endpoints
Via API
Via CLI
Summary
2. An Introduction to Ansible
Ansible overview
What are playbooks, roles, and modules?
Playbooks
Roles
Modules
Variables and facts
Variables
Setting variable placeholders
Defining variable values
Registering variables
Facts
Defining the inventory
Dynamic inventory
Summary
3. Creating Multiple Users/Tenants
Creating users and tenants
Manually creating users and tenants
Creating a user
Creating a tenant
Assigning users role and tenant access
Automation considerations
Defining variables globally or per role
The OpenStack API or CLI
Where to run Ansible
Coding the playbook and roles
The playbook and role review
Summary
4. Customizing Your Cloud's Quotas
Define and create quotas
Creating quotas manually
Setting up default quotas
Reset quota values
Automation considerations
Coding the playbook and roles
Playbook and role review
Summary
5. Snapshot Your Cloud
Define backups and snapshots
Creating backups and snapshots manually
Restore an instance backup
Automation considerations
Coding the playbook and roles
Playbook and role review
Summary
6. Migrating Instances
Instance migration
Manually migrating instances
Migrating an instance to a specific compute node
Automation considerations
Coding the playbook and roles
Playbook and role review
Summary
7. Setting up Isolated Tenants
Multi-tenant isolation explained
Setting up multi-tenant isolation
Pre-configuration steps
Step 1
Step 2
Tenant configuration steps
Step 1 – create a new or use an existing tenant
Step 2 – create new host aggregate
Step 3 – add hosts to the new host aggregate
Step 4 – update host aggregate metadata
Step 5 – create a custom flavor to include the tenant filter
Step 6 – apply volume type quotas
Automation considerations
Coding the playbook and roles
Playbook and role review
Summary
8. Deploying OpenStack Features
Multiple hypervisor support
What is Docker (aka Docker Engine)?
Setting up Docker and nova-docker
Docker configuration
Install Docker on a new compute node
Configuring nova-docker
Step 1 – install nova-docker
Step 2 – update the Nova compute_driver parameter
Step 3 – add the docker.filters file to the Nova rootwrap.d folder
Step 4 – add and remove filters on the compute node(s) Nova scheduler
Step 5 – add and remove filters on the controller node(s) Nova scheduler
Step 6 – create a custom Docker flavor with extra specs
Step 7 – create a new host aggregate for the Docker compute node(s)
Step 8 – add docker to the Glance API container_formats
Coding the playbook and roles
Install Docker
nova-docker
nova-update
openstack-config
nova-scheduler
glance-update
Playbook and role review
Summary
9. Inventory Your Cloud
Collecting cloud metrics
User report
Tenant report
Network report
Volume report
Cloud-at-a-glance report
Coding the playbook and roles
cloud-inventory
cloud-usage
user-inventory
tenant-inventory
network-inventory
volume-inventory
Playbook and role review
Summary
10. Health Check Your Cloud
Monitoring the cloud
OpenStack service processes
Infrastructure services
MariaDB and Galera
RabbitMQ
Core OpenStack services
Service and process check examples
Coding the playbook and roles
cloud-infra-check
cloud-core-os-check
os-service-status
Playbook and role review
Summary
Index
OpenStack Administration with Ansible
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2016
Production reference: 1210116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-461-0
www.packtpub.com
Author
Walter Bentley
Reviewer
Diego Woitasen
Commissioning Editor
Veena Pagare
Acquisition Editor
Meeta Rajani
Content Development Editor
Susmita Sabat
Technical Editor
Madhunikita Sunil Chindarkar
Copy Editor
Sneha Singh
Project Coordinator
Milton Dsouza
Proofreader
Safis Editing
Indexer
Hemangini Bari
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade
Walter Bentley is a private cloud solutions architect with Rackspace. He has a diverse background in production systems administration and solutions architecture. He has over 15 years of experience across numerous industries, such as online marketing, finance, insurance, aviation, food, education, and now in technology product space. In the past, he has typically been the requestor, consumer, and advisor to companies in the use of technologies such as OpenStack. He is now a promoter of OpenStack technology and a cloud educator.
In Walter's current role, he is focused on helping customers build, design, and deploy private clouds built on OpenStack. His role also involves professional services, engagements around operating the built OpenStack clouds, and DevOps engagements creating playbooks/roles with Ansible.
Recently, Walter was given the honor to be present at the OpenStack Vancouver and Tokyo Summits. As well as this, he was given the great opportunity to present at AnsibleFest events in London and New York. Some of his other experiences involve performing webinars, blogging about OpenStack, and speaking at various technology conferences. Another wonderful experience is Walter being allowed to take part in the technica...