Slide 1

Slide 1 text

Life Without DevStack: OpenStack Development With OSA Miguel Grinberg @miguelgrinberg

Slide 2

Slide 2 text

2 About Me ● Software Developer with Rackspace ○ Rackspace Private Cloud ● OpenStack Contributor ○ openstack-ansible, heat, keystone, horizon ● O’Reilly Author ○ Flask Web Development ● Blogger ○ http://blog.miguelgrinberg.com

Slide 3

Slide 3 text

3 Agenda ● What’s Wrong with DevStack? ● What is openstack-ansible (OSA)? ● Installation ● Development Workflow ● Demonstration ● Tips, Tricks & Gotchas ● Pros & Cons

Slide 4

Slide 4 text

4 What’s Wrong with DevStack? ● Monolithic install ● Not possible to modify or reinstall individual services ● All packages are installed for development, not just the one you need. ● Services run in a shared environment ● Dependencies are shared

Slide 5

Slide 5 text

5 What is openstack-ansible (OSA)? ● Ansible playbooks to deploy OpenStack ● Deploys production-ready clouds from a handful of nodes to hundreds or even thousands ● Services are deployed from the git repositories ● No vendor-specific patches or add-ons ● Services are isolated from each other in LXC containers

Slide 6

Slide 6 text

6 OSA Architecture

Slide 7

Slide 7 text

7 OSA All-In-One ● Used by the openstack-ansible team for development, testing and gating ● Can be deployed on a cloud server or virtual machine ● Requirements ○ 16GB RAM ○ 80GB disk space ○ Ubuntu 14.04 ● Redundant services are supported ○ Easy to do when services are isolated in containers! ○ HAProxy is installed on the host to load balance

Slide 8

Slide 8 text

8 OSA All-In-One Installation ● Install on a fresh Ubuntu 14.04 host # git clone https://github.com/openstack/openstack-ansible \ /opt/openstack-ansible # cd /opt/openstack-ansible # scripts/bootstrap-aio.sh # scripts/bootstrap-ansible.sh # vi /etc/openstack_deploy/... # scripts/run-playbooks.sh ← Set up host and config files ← Customize configuration (optional) ← Install Ansible ← Install or update OpenStack

Slide 9

Slide 9 text

9 LXC Cheat Sheet # list all containers in a host lxc-ls [--fancy|-f] # access a container’s console lxc-attach -n # start a container as a daemon lxc-start -d -n # stop and destroy a container lxc-stop -n lxc-destroy -n

Slide 10

Slide 10 text

10 1. Deploy OSA-AIO 2. Attach to the target container 3. Stop the target service 4. Clone development version 5. Update dependencies 6. Sync database 7. Make changes to the original config files, if necessary 8. Run manually, or install and run as a service Development Workflow

Slide 11

Slide 11 text

Demonstration https://asciinema.org/a/28461

Slide 12

Slide 12 text

12 Where is Everything ● The container file systems are accessible in the host at /var/lib/lxc//rootfs ● Logs are in the host at /openstack/log/ ● Each container has its virtual environments in /openstack/venvs ● HAProxy is running on the host ○ The service configuration files are in /etc/haproxy/conf.d/*

Slide 13

Slide 13 text

13 Tips, Tricks & Gotchas ● Python packages and the cheese shop ○ openstack-ansible creates its own private package repository ○ To enable access to external packages, disable option no-index in ~/. pip/pip.conf ● Using debuggers ○ Terminal based debuggers work great inside containers (pudb, pdb) ○ Remote debugging from host to container works too (pycharm, pydev)

Slide 14

Slide 14 text

14 Tips, Tricks & Gotchas (cont’d) ● Fix Apache configuration (keystone and horizon only) ○ To run the service from the home directory, add home=/root/ to the WSGI setup in the apache site configuration file ● Database migrations don’t have downgrade ○ Backup and restore the database if you need to downgrade ○ Or delete the database, and let the playbooks create a new one ● Galera restarts are tricky ○ See documentation for restart instructions

Slide 15

Slide 15 text

15 OSA-AIO: The Pros ● Less dependency headaches ● Easy to partially update a live system ● Easy to restore a dead or sick system ● Closer to the real thing

Slide 16

Slide 16 text

16 OSA-AIO: The Cons ● Only core services supported at this time ○ nova, neutron, keystone, glance, cinder, swift, heat, ceilometer, horizon ○ We welcome contributions with open arms! ● Strongly opinionated networking ○ Linux Bridge or bust!

Slide 17

Slide 17 text

Help Wanted We welcome new contributors! Talk to us on freenode: #openstack-ansible

Slide 18

Slide 18 text

© RACKSPACE. LTD. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN THE UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.COM ONE FANATICAL PLACE | SAN ANTONIO, TX 78218 US SALES: 1-800-961-2888 | US SUPPORT: 1-800-961-4454 | WWW.RACKSPACE.COM Thank You (Read my blog post: http://bit.ly/osa-devel)