cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lei <ryan...@cht.com.tw>
Subject Re: Tracing registerTemplate API, is it possible to connect Eclipse debugger to System VMs?
Date Tue, 23 Jul 2013 08:31:49 GMT
Great! I have successfully connected Eclipse debugger to the System VM
agent, but the steps are slightly different. See below:

* Step 4: I put that long string of arguments right after "java" instead of
at the very end.

If put at the very end, the command
"java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -mx${maxmem}m
-cp $CP com.cloud.agent.AgentShell $keyvalues $@ -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787" would result
in invalid parameters:

Invalid Parameter: -Xdebug
Invalid Parameter:
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787

* Step 6: I used "iptables -A INPUT -i eth1 -p tcp -m state --state NEW -m
tcp --dport 8787 -j ACCEPT" instead, as suggested by the Internet.
"iptables -I INPUT -I eth1 -p tcp -m state --state NEW -m tcp --dport 8787
-j ACCEPT" gave me error "iptables v1.4.8: Cannot use -I with -I"

The first -I may be OK, but at least the second -I should be the lowercase
-i, which means the network interface.

I'm not very familiar with such commands, so I'm not 100% sure if I'm
right. If necessary, please modify the wiki page for me.

-------------------------------------------------------------------------------------------
Yu-Heng (Ryan) Lei, Associate Reasearcher
Chunghwa Telecom Laboratories / Cloud Computing Laboratory
ryanlei@cht.com.tw<https://email.cht.com.tw/owa/redir.aspx?C=-wE1FEC3G0SWYpVkiWo8SsDdf3ZqO9AIuAPTzRnFYCUi-z4YljtI_hyVKkNHfn9F1Bn-vUWJnQ4.&URL=mailto%3aryanlei%40cht.com.tw>
or
ryanlei750328@gmail.com


On Tue, Jul 23, 2013 at 4:53 AM, Edison Su <Edison.su@citrix.com> wrote:

> Yah, you need Eclipse connects to the java agent running on SSVM.
> You can use the following steps:
> 1. login into ssvm, either console proxy or ssh(port 3922)
> 2. kill all the processes named as(run.sh/_run.sh, and java)
> 3. cd /usr/local/cloud/systemvm
> 4. add the " -Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address={8787}" at end of
> "java " in _run.sh
> 5. ./run.sh, the java agent will start, with debug port 8787 is listened
> on.
> 6. allow port 8787 in ssvm, "iptables -I INPUT -I eth1 -p tcp -m state
> --state NEW -m tcp --dport 8787 -j ACCEPT", either eth1 or eth2 is ok.
> Then you can connect to agent in ssvm, based on the ip address based on on
> eth1 or eth2, and port 8787
>
> Or above steps sound too complicated to you, you can debug resource code
> locally.
> For example, There is an unit test code, called,
> LocalNfsSecondaryStorageResourceTest, on 4.2 branch, you can mock the
> commands send to resource, then test it locally, but the requirement is
> that your local machine needs to be able to mount nfs(Both Linux/Mac works,
> Windows can't).
> I'd prefer unit test, as it's easier to test/debug/fix.
>
> > -----Original Message-----
> > From: ryanlei750328@gmail.com [mailto:ryanlei750328@gmail.com] On
> > Behalf Of Ryan Lei
> > Sent: Monday, July 22, 2013 3:10 AM
> > To: dev@cloudstack.apache.org
> > Subject: Tracing registerTemplate API, is it possible to connect Eclipse
> > debugger to System VMs?
> >
> > Hi, I've been trying to study how System VMs work in CloudStack code.
> >
> > Tracing the creation of SSVM and CPVM was not a problem. It has to do
> with
> > updateZone API (&allocationstate=Enabled) and SystemVmLoadScanner.java
> > for both secondary storage and console proxy.
> >
> > But the next usage case, registering a template, was not as
> straightforward.
> > Tracing the registerTemplate API lead me to a dead end in the send()
> > method in cloud-utils -> com.cloud.utils.nio.Link.java, whose previous
> step is
> > _link.send(req.toBytes()) in cloud-server ->
> > com.cloud.agent.manager.ConnectedAgentAttache.java.
> >
> > From the MS log, it seems after the DownloadCommand is sent in
> > agent.transport.Request, the registerTemplate API ends.
> > http://apaste.info/pM1E
> >
> > So how do I trace the next Java steps on the SSVM part? Is it possible to
> > connect Eclipse debugger to System VMs? Or what is the best way to trace
> > the interaction between MS and System VMs that involves an agent
> > command?
> >
> > Thanks
> >
> >
> -------------------------------------------------------------------------------------------
> > Yu-Heng (Ryan) Lei, Associate Reasearcher Chunghwa Telecom Laboratories /
> > Cloud Computing Laboratory
> > ryanlei@cht.com.tw<https://email.cht.com.tw/owa/redir.aspx?C=-
> > wE1FEC3G0SWYpVkiWo8SsDdf3ZqO9AIuAPTzRnFYCUi-
> > z4YljtI_hyVKkNHfn9F1Bn-vUWJnQ4.&URL=mailto%3aryanlei%40cht.com.tw>
> > or
> > ryanlei750328@gmail.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message