12
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.

Developing with-devstack

Embed Size (px)

DESCRIPTION

How to hack into Openstack using Devstack

Citation preview

Page 1: Developing with-devstack

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.

Page 2: Developing with-devstack

Contents● Project Details● Important files● localrc vars● Hypervisor● Tips & Tricks● Developing and Debugging● Workflow● DevStackPy

Page 3: Developing with-devstack

Project Details

Project Homepage: http://devstack.org

$ git clone https://github.com/openstack-dev/devstack.git

$ cd devstack $ ./stack.sh

A documented shell script to build complete OpenStack development environments.

Page 4: Developing with-devstack

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

Page 5: Developing with-devstack

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

Page 6: Developing with-devstack

localrc vars● MYSQL_PASSWORD=ms

● MYSQL_USER=root

● ADMIN_PASSWORD=adminsecret

● FIXED_RANGE=192.168.10.0/24

● ENABLED_SERVICES+=",q-svc,quantum,q-agt,swift,n-cauth,melange,m-svc,mysql"

● Q_PLUGIN=openvswitch

● RABBIT_PASSWORD=rabbitsecret

● SERVICE_TOKEN=admintoken

● SWIFT_HASH=deep

● SERVICE_PASSWORD=sp

● #OFFLINE=True

● #RECLONE=yes

Page 7: Developing with-devstack

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

Page 8: Developing with-devstack

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

● If you are a developer then you should definitely read the well documented stack.sh script.

$ sudo visudodeepak ALL = (ALL) NOPASSWD:ALL

Page 9: Developing with-devstack

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

● Create a mysql db user called 'stack' or use 'root' in your localrc

screen -d -m -S <screen-name> -t shell -s /bin/bash

$ screen -x stack

Page 10: Developing with-devstack

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

Page 11: Developing with-devstack

DevStackPy

● Written in python● Pretty well maintained, not as much as

original DevStack● Good for example code, small recipes● Worth giving a look once.

Page 12: Developing with-devstack

deepakgarg.iitgdeepakgarg.iitg@@gmail.comgmail.com

@donji@donji

github.com/gargdeepakgithub.com/gargdeepakslideshare.net/khinnu4u/presentationsslideshare.net/khinnu4u/presentations