1. Developing with DevStack
Deepak Garg
OpenStack Developer
Citrix R&D, India
Openstack July Meetup 2012 by Deepak Garg is licensed under a
Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at www.slideshare.net/khinnu4u/presentations.
2. Contents
● Project Details
● Important files
● localrc vars
● Hypervisor
● Tips & Tricks
● Developing and Debugging
● Workflow
● DevStackPy
3. Project Details
A documented shell script to build complete OpenStack
development environments.
Project Homepage: http://devstack.org
$ git clone https://github.com/openstack-dev/devstack.git
$ cd devstack
$ ./stack.sh
4. Important files
localrc: localrc is a user-maintained setings file that
is sourced from stackrc. This gives it the ability to
override any variables set in stackrc.
Samples: http://devstack.org/localrc.html
stackrc: git repo and branch information, image
download location. This file shouldn't be modified,
only localrc should be modified.
stack.sh: stack.sh is an opinionated OpenStack
developer installation. It installs and configures
various combinations of Glance, Horizon, Keystone,
Nova, Quantum Swift and some other projects
5. Important files
exercise.sh: setting up the env for running the
sample exercise cmds
exercises/ folder: contains a small set of exercise
file for achieving different functionalities
7. Hypervisor
● Verify AMD V CPU Virtualization Extensions
# grep color svm /proc/cpuinfo
● Verify Intel VT CPU Virtualization Extensions
# grep color vmx /proc/cpuinfo
● If you are running in a VM, then the underlying hypervisor
will be Qemu after the Installation
● If no configuration is in localrc then it will try to install kvm
plugins
● Otherwise you can specifically mention the reqd. Conf in
localrc
8. Tips & Tricks
● RECLONE=yes/no
● OFFLINE=True/False
Fake an IP: $ sudo ifconfig eth0 10.10.0.2/24 up
● Stack.sh cannot be run as root, so it tries
to sudo. Enable Passwordless sudo o.w
the script will ask for passwords each time
$ sudo visudo
deepak ALL = (ALL) NOPASSWD:ALL
● If you are a developer then you should
definitely read the well documented
stack.sh script.
9. Developing and Debugging
●
/opt/stack is the directory of the packages
● Make the file changes and restart the
service
● Use screen to see the logging output
$ screen -x stack
screen -d -m -S <screen-name> -t shell -s /bin/bash
● Create a mysql db user called 'stack' or
use 'root' in your localrc
10. Workflow
➔ Run the Devstack script
➔ Point your IDE (Eclipse) to /opt/stack
➔ Make code changes
➔ Go to respective service in the screen
➔ Restart the service
➔ Test and Check log msgs
➔ Commit & Push your code using gerrit
11. DevStackPy
● Written in python
● Pretty well maintained, not as much as
original DevStack
● Good for example code, small recipes
● Worth giving a look once.