Ask Your Question
0

how can i trace a request from Horizon to Nova

asked 2014-10-21 12:33:22 -0500

sushilb gravatar image

I am looking to make some changes in Nova. Before doing that I want to understand what all parameters pass to Nova how it connects to Database and other components on Code level as architecture level is fine.

Can someone suggest anything

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-10-21 14:28:42 -0500

larsks gravatar image

Horizon talks to Nova using the published REST API. It uses the compute api and the compute extensions. If you want to see what's happening, you can watch the Nova api log (often /var/log/nova/nova-api.log) on your controller, or consider something like tcpdump for traffic on port 8774 (which is the nova-api port).

Horizon uses the code in the python-novaclient module to communicate with Nova, so reading through the code and docs on that module might also help.

If you are looking for something more specific, it would be helpful if you could clarify that in your questions.

edit flag offensive delete link more

Comments

Yes, @larsks +1, exactly what i had in mind !!

Syed Awais Ali gravatar imageSyed Awais Ali ( 2014-10-27 06:29:05 -0500 )edit
0

answered 2014-10-27 03:10:33 -0500

bdastur-s gravatar image

updated 2014-10-27 03:14:37 -0500

I have used pdb (Python Debugger) to trace similar code path. Here is what I would do (considering this is a test system, where you can start services in debugger):

  1. See what nova processes are running on your controller node. "systemctl | grep nova"
  2. From nova-api.log, I grep'ed certain keywords to find the function in compute/api.py.
  3. Add breakpoints in the code "/usr/lib/python2.7/site-packages/nova/<your path="" file="">", using import pdb; pdb.set_trace()
  4. Start the process manually: eg: "systemctl stop openstack-nova-api.service"; /usr/bin/python /usr/bin/nova-api

Once you hit the break point you will be in pdb mode, it is very convenient to step through the code. You can do anything here, get backtrace, check variables, arguments and a lot more.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-10-21 12:33:22 -0500

Seen: 735 times

Last updated: Oct 27 '14