Difference between revisions of "Nova/RemoteDebugging"
Tracy Jones (talk | contribs) (→Preparing the server) |
Tracy Jones (talk | contribs) (→Preparing the server) |
||
Line 10: | Line 10: | ||
=== Preparing the server === | === Preparing the server === | ||
− | Start pycharm and create a remote debug runtime configuration. Change the host and port to your IP address and the port you want to use. | + | === Configuring pycharm for remote debugging === |
− | + | ||
+ | Start pycharm and create a remote debug runtime configuration. Change the host and port to your IP address and the port you want to use. The path map shows how to translate the path in your nova environment to the path that your debug server understands. The example here shows /opt/stack/nova mapped to /Volume/OpenStack/nova. I have used samba to mount my /opt/stack directory on my debug host at mount point /Volume/Openstack. You need this or you will not be able to see your code and set breakpoints. | ||
+ | |||
[[File:Pycharm remote debug setup.png|framed|left|Pycharm Remote Debug Configuration]] | [[File:Pycharm remote debug setup.png|framed|left|Pycharm Remote Debug Configuration]] | ||
− | + | ||
− | + | === Running the debugger in pycharm === | |
+ | |||
Once you have the configuration done, press the bug to start the debugger | Once you have the configuration done, press the bug to start the debugger | ||
− | + | ||
[[File:Start Debbugging.png|framed|left|Start the debugger]] | [[File:Start Debbugging.png|framed|left|Start the debugger]] | ||
− | + | ||
− | + | === Debugger waiting for connection === | |
+ | |||
You should see the debugger waiting for connection | You should see the debugger waiting for connection | ||
<br> | <br> |
Revision as of 19:45, 13 December 2013
Contents
Remote Debugging in Nova
You can use a remote debugger to attach to nova services by specifying the host and port as command line arguments. For example
/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf --remote_debug-host 172.16.245.1 --remote_debug-port 1234
In order to do this you need to have a remote debug server - this wiki describes how to use remote debugging with pycharm. You need a commercial license to do remote debugging with pycharm.
Preparing the server
Configuring pycharm for remote debugging
Start pycharm and create a remote debug runtime configuration. Change the host and port to your IP address and the port you want to use. The path map shows how to translate the path in your nova environment to the path that your debug server understands. The example here shows /opt/stack/nova mapped to /Volume/OpenStack/nova. I have used samba to mount my /opt/stack directory on my debug host at mount point /Volume/Openstack. You need this or you will not be able to see your code and set breakpoints.
Running the debugger in pycharm
Once you have the configuration done, press the bug to start the debugger
Debugger waiting for connection
You should see the debugger waiting for connection
Preparing the client
First you need to copy the pydev client script to the environment where you are running nova services.