Hi Prakhar,<br><br>The Java OCA is a wrapper for the XML-RPC interface [1].<br>The image file manipulation done by the oneimage command is performed by the ImageRepository.rb [2] utility. You can take a look at the code to get an idea of the steps. Or even check this thread [3].<br>
<br>Your Java application has to be aware of that, and perform the same file operations, as described in [4].<br><br>Regards,<br>Carlos.<br><br>[1] <a href="http://opennebula.org/documentation:rel2.2:api">http://opennebula.org/documentation:rel2.2:api</a><br>
[2] <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/one-2.2/entry/src/oca/ruby/OpenNebula/ImageRepository.rb">http://dev.opennebula.org/projects/opennebula/repository/revisions/one-2.2/entry/src/oca/ruby/OpenNebula/ImageRepository.rb</a><br>
[3] <a href="http://www.mail-archive.com/users@lists.opennebula.org/msg02744.html">http://www.mail-archive.com/users@lists.opennebula.org/msg02744.html</a><br>[4] <a href="http://opennebula.org/documentation:rel2.2:img_template#notes_for_developers">http://opennebula.org/documentation:rel2.2:img_template#notes_for_developers</a><br>
<br><br clear="all"><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial, sans-serif;font-size:13px">--<br>Carlos Martín, MSc<br>Project Major Contributor<br><span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span> - The Open Source Toolkit for Cloud Computing<br>
<a href="http://www.opennebula.org/" style="color:rgb(42, 93, 176)" target="_blank">www.<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span>.org</a> | <a href="mailto:cmartin@opennebula.org" style="color:rgb(42, 93, 176)" target="_blank">cmartin@<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">opennebula</span>.org</a></span><br>
<br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 10:49 AM, Prakhar Srivastava <span dir="ltr"><<a href="mailto:prakhar.apj@gmail.com">prakhar.apj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div>Thanks a lot for the response.</div><div>Here is the output of, onevm show after onevm saveas</div><div><br></div><div><div>VIRTUAL MACHINE 109 INFORMATION </div><div>
ID : 109 </div><div>NAME : test2 </div><div>STATE : ACTIVE </div><div>LCM_STATE : RUNNING </div><div>START TIME : 04/28 14:06:06 </div>
<div>END TIME : - </div><div>DEPLOY ID: : one-109 </div><div><br></div><div>VIRTUAL MACHINE MONITORING </div><div>NET_TX : 0 </div>
<div>NET_RX : 0 </div><div>USED MEMORY : 0 </div><div>USED CPU : 0 </div><div><br></div><div>VIRTUAL MACHINE TEMPLATE </div>
<div>CONTEXT=[</div><div> DNS_PUBLIC=192.168.150.226,</div><div> FILES=/home/cloud/opennebula/images/init.sh /root/.ssh/id_dsa.pub,</div><div> GATEWAY_PUBLIC=192.168.145.1,</div><div> HOSTNAME=test2,</div><div> IP_PUBLIC=192.168.145.69,</div>
<div> ROOT_PUBKEY=id_dsa.pub,</div><div> TARGET=xvdc ]</div><div>CPU=1</div><div>DISK=[</div><div> CLONE=YES,</div><div> DISK_ID=0,</div><div> DRIVER=file:,</div><div> IMAGE=DebianLenny3,</div><div> IMAGE_ID=5,</div>
<div> READONLY=NO,</div><div> SAVE=YES,</div><div> SAVE_AS=6,</div><div> SOURCE=/srv/cloud/one/var//images/b870fb155609d982de48a9b050e2b8c8790aa953,</div><div> TARGET=xvda,</div><div> TYPE=DISK ]</div><div>DISK=[</div>
<div> DISK_ID=1,</div><div> DRIVER=file:,</div><div> READONLY=no,</div><div> SIZE=1024,</div><div> TARGET=xvdd,</div><div> TYPE=swap ]</div><div>MEMORY=256</div><div>NAME=test2</div><div>NIC=[</div><div> BRIDGE=eth0,</div>
<div> IP=192.168.145.69,</div><div> MAC=02:00:c0:a8:91:45,</div><div> NETWORK=Public,</div><div> NETWORK_ID=4 ]</div><div>OS=[</div><div> INITRD=/home/cloud/kernel/xen/2/initrd-2.6.27.21-0.1-xen,</div><div> KERNEL=/home/cloud/kernel/xen/2/vmlinuz-2.6.27.21-0.1-xen,</div>
<div> KERNEL_CMD=xencons=tty,</div><div> ROOT=xvda ]</div><div>VCPU=1</div><div>VMID=109</div><div><br></div>I uncommented the image hooks in oned.conf and restarted one daemon. This time it worked as expected. The oneimage list listed the new image and its corresponding image file was found in /srv/lcoud/one/var/images.</div>
<div><br></div><div>I have one another issue. The JAVA OCA has a savedisk() method for the same functionality but its asks for the image ID. I expected it to ask the new image name similar to the input taken by onevm saveas command. How to achieve the same functionality using the JAVA OCA.</div>
<div><br></div><div>Thanks</div><div>Prakhar</div><div><div></div><div class="h5"><div><br></div><div><div class="gmail_quote">On Thu, Apr 28, 2011 at 3:59 AM, Daniel Molina <span dir="ltr"><<a href="mailto:dmolina@opennebula.org" target="_blank">dmolina@opennebula.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Check that the image hook is uncommented in the oned.conf.</div><div>Would you mind to send us the output of onevm show VMID after the saveas command.</div>
<div><br></div><div>Regards<br><br><div class="gmail_quote"><div><div></div><div>
On 27 April 2011 10:53, Prakhar Srivastava <span dir="ltr"><<a href="mailto:prakhar.apj@gmail.com" target="_blank">prakhar.apj@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>
Hi,<div>When I run the command,</div><div> onevm saves VMID DISKID IMAGENAME</div><div>the image of the disk is successfully saved upon shutdown of the VM, however the the file with a hash string name in (/srv/cloud/one/var/images) is not created. So when I use the image in any VM, it compains that the file cannot be found in /srv/cloud/one/var/images. </div>
<div><div>Tue Apr 26 20:59:36 2011 [LCM][I]: New VM state is SHUTDOWN</div><div>Tue Apr 26 20:59:44 2011 [LCM][I]: New VM state is EPILOG</div><div>Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Moving /srv/cloud/one/var//90/images/disk.0</div>
<div>Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Executed "/usr/bin/ssh box1 mkdir -p /srv/cloud/one/var/90".</div><div>Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Executed "/usr/bin/scp -r 192.168.145.116:/srv/cloud/one/var//90/images/disk.0 box1:/srv/cloud/one/var/90/disk.0".</div>
<div>Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Executed "/usr/bin/ssh 192.168.145.116 rm -rf /srv/cloud/one/var//90/images/disk.0".</div><div>Tue Apr 26 21:01:16 2011 [TM][I]: tm_delete.sh: Deleting /srv/cloud/one/var//90/images</div>
<div>Tue Apr 26 21:01:16 2011 [TM][I]: tm_delete.sh: Executed "/usr/bin/ssh 192.168.145.116 rm -rf /srv/cloud/one/var//90/images".</div><div>Tue Apr 26 21:01:16 2011 [DiM][I]: New VM state is DONE</div></div><div>
<br></div><div><br></div><div><br></div><div>Isn't the image supposed to be registered during the save process.</div><div>Anyhow I am able to use the image by using a template file providing the source as the disk image saved and then registering it with a different name.</div>
<div><br></div><div>Please advice.</div><div><br></div><font color="#888888"><div>Prakhar</div>
</font><br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Daniel Molina, Cloud Technology Engineer/Researcher<br>Major Contributor<br><div>OpenNebula - The Open Source Toolkit for Cloud Computing</div><div><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:dmolina@opennebula.org" target="_blank">dmolina@opennebula.org</a></div>
<br>
</div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br>