Mastering OpenStack(Second Edition)
上QQ阅读APP看书,第一时间看更新

Ansible for OpenStack

OpenStack Ansible (OSA) is an official OpenStack big tent project. It focuses on providing roles and playbooks for deploying a scalable, production-ready OpenStack setup. It has a very active community of developers and users collaborating to stabilize and bring new features to OpenStack deployment.

The official OpenStack-Ansible repository and documentation can be found at GitHub: https://github.com/openstack/openstack-ansible

One of the unique features of the OSA project is the use of containers to isolate and manage OpenStack services. OSA installs OpenStack services in LXC containers to provide each service with an isolated environment.

LXC is an OS-level container, and it encompasses a complete OS environment that includes a separate filesystem, networking stack, and resource isolation using cgroups.

Containerization technology enhanced the chroot concept within the Linux operating system. LXC is a very popular implementation of containers in Linux, allowing the isolation of resources, including filesystems, to run multiple applications and group of processes without interfering with each other.

OpenStack services are spawned in separate LXC containers and communicate to each other using the REST APIs. The microservice-based architecture of OpenStack complements the use of containers to isolate services. It also decouples the services from the physical hardware and provides encapsulation of the service environment that forms the foundation for providing portability, high availability, and redundancy.

Microservice architecture has become a highly-adopted approach for developing applications at a fast and efficient pace. The foundation of the microservice model has become more solid with the rise of cloud technology. Microservice patterns help developers to overcome the challenge of a monolithic application by converting it to a suite of modular services easy to deploy, fast to go to production, being scalable, and reusable. Using containers in a based microservice architectural setup enables developers to gain more granularity and much more flexibility during testing and deployment.

The OSA deployment is initiated from a deployment host. The deployment host is installed with Ansible and it runs the OSA playbooks to orchestrate the installation of OpenStack on the target hosts:

The Ansible target hosts are the ones that will run the OpenStack services. The target nodes can be installed with Ubuntu 14.04 LTS and configured with SSH-key-based authentication to allow login from the deployment host.