This repo contains everything required to deliver an introduction to OpenStack workshop. Within the activities directory are two labs that introduce the user to the nova CLI and the API through the python-novaclient. The setup directory contains the scripts and automation for deploying devstack instances into AWS. Finally the ittlcsite contains a simple Django app for registering devstack instances and logins as servers are deployed so the logins can later be allocated to the lab participants. Lastly, for those users that do not have or don't want to install an SSH client we have included an HTML5 based (GateOne) ssh client on each of the devstack instances.
Managing Openstack through nova CLI (Command Line Interface) and using the Dashboard
- Users will be introduced to nova CLI.
- Using various nova commands users will check services, launch instances, create security keypairs and login into the instance created
- Users will be introduced to the API through the python-novaclient module.
- Similar to what was done in Lab 1, users will be able to use the python novaclient to list available images, flavors and to launch and destroy their instance.
We deploy devstack on a Ubuntu Cloud Imagei (12.04). The image contains CloudInit a facility to bootstrap automation and customizations which we leveraged to add/install manage users, devstack, ssh, GateOne (html5 ssh client) and integrate with our server/login registration app.
Scripts to provision EC2 instances: ./setup/bin/create_*_devstack_instance.py
CloudInit handles early initialization of a cloud instance. Some of the things it can configure include locale, hostname, generating and managing ssh keys, setting up ephemeral mount points, installing apps, etc. We choose to use a Mime Multi Part archive so that we could separate the automation into multiple scripts. We have a script for creating users, installing devstack and installing GateOne.
Create multipart user_data: write-mime-multipart setup/user_data/10_create_users setup/user_data/20_install_devstack setup/user_data/30_install_gateone setup/user_data/40_install_misc > setup/user_data/user_data
The resulting setup/user_data/user_data file is referenced by the boto run_instance call in the create scripts located in setup/bin.
The directory ittlcsite contains a Django web app app for handling server and login registration. The app provides REST service endpoints for registering servers/logins and allocating users to available logins. The app depends on sqllite and can easily be hosted on an micro ec2 instance.