Developing + Debugging Quantum via Devstack

Asked by Ronak Shah

Hi,
I am new to the OpenStack. I have installed it using devstack on of the self created ubuntu based hypervisor and want to play with Quantum. I was wondering besides seeing logs, if I were to make changes to the code, add traces to the code what is the best way of doing it.

By default i see that code is in my /opt/stack/quantum/.
I believe I can make code changes there. But once that is done, what steps are required such that the quantum components are updated at runtime? Will stopping and starting all quantum services do? If yes, is this possible in devstack as they dont seem to be running them as services?

I would appreciate help here.

Thanks,
Ronak

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
Miguel Lavalle
Solved:
Last query:
Last reply:
Revision history for this message
dan wendlandt (danwent) said :
#1

you can access screen windows running each of the openstack services by running: screen -x stack

the quantum service windows all have names starting with "q-"

for most changes, you should just be able to control-c and then restart the services to pick up changes you made in /opt/stack/quantum

if you make more fundamental changes (e.g., to the database) or want to start with a clean setup, just run:

./unstack.sh
./stack.sh

Revision history for this message
Ronak Shah (ronak-malav-shah) said :
#2

The problem that I am facing is I dont see screen getting created.

screen -x stack returns:

stack@hypervisor4:/opt/stack/devstack$ sudo screen -x stack
There is no screen to be attached matching stack.
stack@hypervisor4:/opt/stack/devstack$screen -x stack
Cannot open your terminal '/dev/pts/1' - please check.

However, when stack.sh is getting executed I do see msgs as below:
screen -S stack -X screen -t n-obj

What can be going wrong here?

Revision history for this message
Miguel Lavalle (minsel) said :
#3

Ronak,

Just go to the directory where you cloned DevStack and you will find the following screen:

rejoin-stack.sh

Execute it, Once inside, type CTRL-A " and you will get something like:

  1 key $
  2 horizon $
  3 g-reg $
  4 g-api $
  5 n-api $
  6 q-svc $
  7 q-agt $
  8 q-dhcp $
  9 q-l3 $
 10 n-cond $
 11 n-cpu $
 12 n-crt $
 13 n-sch $
 14 n-novnc $
 15 n-xvnc $
 16 n-cauth $
 17 c-api $
 18 c-vol $
 19 c-sch $
 20 n-obj $

Just move with your keyboard arrows to the screen you want to go to and type enter

Regards

Revision history for this message
Best Miguel Lavalle (minsel) said :
#4

ronak,

In the first line of my response, I meant:

Just go to the directory where you cloned DevStack and you will find the following SCRIPT:

Revision history for this message
dan wendlandt (danwent) said :
#5

the error you are getting from devstack is likely because stack.sh was run by someone other than the current user you are using to run screen -x stack.

you can either rerun stack.sh as the right user, su to the user that ran stack.sh, or chmod the /dev/pts/X file to something to make it readable by the current users (for example, if this is a dev box where you are not worried about security between multiple users, you could do "chmod 777 /dev/pts/1".

Revision history for this message
Ronak Shah (ronak-malav-shah) said :
#6

Thank you Miguel,
What you say works.

Ronak

Revision history for this message
Ronak Shah (ronak-malav-shah) said :
#7

Thanks Dan.
/dev/pts/X was accessible only by root and I created devstack with user stack.
changing chmod worked. I will change chmod just for stack. May be it would be a good feedback for devstack documents to include these steps as well.