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.
Contents● Project Details● Important files● localrc vars● Hypervisor● Tips & Tricks● Developing and Debugging● Workflow● DevStackPy
Project DetailsA 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
Important fileslocalrc: localrc is a user-maintained setings file thatis sourced from stackrc. This gives it the ability tooverride any variables set in stackrc.Samples: http://devstack.org/localrc.htmlstackrc: git repo and branch information, imagedownload location. This file shouldnt be modified,only localrc should be modified.stack.sh: stack.sh is an opinionated OpenStackdeveloper installation. It installs and configuresvarious combinations of Glance, Horizon, Keystone,Nova, Quantum Swift and some other projects
Important filesexercise.sh: setting up the env for running thesample exercise cmdsexercises/ folder: contains a small set of exercisefile for achieving different functionalities
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
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.
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
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
DevStackPy● Written in python● Pretty well maintained, not as much as original DevStack● Good for example code, small recipes● Worth giving a look once.