[one-users] onevm saveas command

Prakhar Srivastava prakhar.apj at gmail.com
Thu Apr 28 13:37:27 PDT 2011


Hi Carlos,
Thanks a ton for all this information.
>From the onevm saveas code, I have identified that a new image has to be
allocated before it can be used to save a running VMs disk image. So I need
to create a new virtual image before I can call the savedisk method on the
VM by using the new image id.

Thanks,
Prakhar

2011/4/28 Carlos Martín Sánchez <cmartin at opennebula.org>

> Hi Prakhar,
>
> The Java OCA is a wrapper for the XML-RPC interface [1].
> 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].
>
> Your Java application has to be aware of that, and perform the same file
> operations, as described in [4].
>
> Regards,
> Carlos.
>
> [1] http://opennebula.org/documentation:rel2.2:api
> [2]
> http://dev.opennebula.org/projects/opennebula/repository/revisions/one-2.2/entry/src/oca/ruby/OpenNebula/ImageRepository.rb
> [3] http://www.mail-archive.com/users@lists.opennebula.org/msg02744.html
> [4]
> http://opennebula.org/documentation:rel2.2:img_template#notes_for_developers
>
>
> --
> Carlos Martín, MSc
> Project Major Contributor
>
> OpenNebula - The Open Source Toolkit for Cloud Computing
> www.OpenNebula.org <http://www.opennebula.org/> | cmartin at opennebula.org
>
>
>
> On Thu, Apr 28, 2011 at 10:49 AM, Prakhar Srivastava <
> prakhar.apj at gmail.com> wrote:
>
>> Hi,
>> Thanks a lot for the response.
>> Here is the output of, onevm show after onevm saveas
>>
>> VIRTUAL MACHINE 109 INFORMATION
>>
>> ID             : 109
>> NAME           : test2
>> STATE          : ACTIVE
>> LCM_STATE      : RUNNING
>> START TIME     : 04/28 14:06:06
>> END TIME       : -
>> DEPLOY ID:     : one-109
>>
>> VIRTUAL MACHINE MONITORING
>>
>> NET_TX         : 0
>> NET_RX         : 0
>> USED MEMORY    : 0
>> USED CPU       : 0
>>
>> VIRTUAL MACHINE TEMPLATE
>>
>> CONTEXT=[
>>   DNS_PUBLIC=192.168.150.226,
>>   FILES=/home/cloud/opennebula/images/init.sh /root/.ssh/id_dsa.pub,
>>   GATEWAY_PUBLIC=192.168.145.1,
>>   HOSTNAME=test2,
>>   IP_PUBLIC=192.168.145.69,
>>   ROOT_PUBKEY=id_dsa.pub,
>>   TARGET=xvdc ]
>> CPU=1
>> DISK=[
>>   CLONE=YES,
>>   DISK_ID=0,
>>   DRIVER=file:,
>>   IMAGE=DebianLenny3,
>>   IMAGE_ID=5,
>>   READONLY=NO,
>>   SAVE=YES,
>>   SAVE_AS=6,
>>
>>   SOURCE=/srv/cloud/one/var//images/b870fb155609d982de48a9b050e2b8c8790aa953,
>>   TARGET=xvda,
>>   TYPE=DISK ]
>> DISK=[
>>   DISK_ID=1,
>>   DRIVER=file:,
>>   READONLY=no,
>>   SIZE=1024,
>>   TARGET=xvdd,
>>   TYPE=swap ]
>> MEMORY=256
>> NAME=test2
>> NIC=[
>>   BRIDGE=eth0,
>>   IP=192.168.145.69,
>>   MAC=02:00:c0:a8:91:45,
>>   NETWORK=Public,
>>   NETWORK_ID=4 ]
>> OS=[
>>   INITRD=/home/cloud/kernel/xen/2/initrd-2.6.27.21-0.1-xen,
>>   KERNEL=/home/cloud/kernel/xen/2/vmlinuz-2.6.27.21-0.1-xen,
>>   KERNEL_CMD=xencons=tty,
>>   ROOT=xvda ]
>> VCPU=1
>> VMID=109
>>
>> 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.
>>
>> 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.
>>
>> Thanks
>> Prakhar
>>
>> On Thu, Apr 28, 2011 at 3:59 AM, Daniel Molina <dmolina at opennebula.org>wrote:
>>
>>> Hi,
>>>
>>> Check that the image hook is uncommented in the oned.conf.
>>> Would you mind to send us the output of onevm show VMID after the saveas
>>> command.
>>>
>>> Regards
>>>
>>> On 27 April 2011 10:53, Prakhar Srivastava <prakhar.apj at gmail.com>wrote:
>>>
>>>>  Hi,
>>>> When I run the command,
>>>>   onevm saves VMID DISKID IMAGENAME
>>>> 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.
>>>> Tue Apr 26 20:59:36 2011 [LCM][I]: New VM state is SHUTDOWN
>>>> Tue Apr 26 20:59:44 2011 [LCM][I]: New VM state is EPILOG
>>>> Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Moving
>>>> /srv/cloud/one/var//90/images/disk.0
>>>> Tue Apr 26 21:01:15 2011 [TM][I]: tm_mv.sh: Executed "/usr/bin/ssh box1
>>>> mkdir -p /srv/cloud/one/var/90".
>>>> 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".
>>>> 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".
>>>> Tue Apr 26 21:01:16 2011 [TM][I]: tm_delete.sh: Deleting
>>>> /srv/cloud/one/var//90/images
>>>> 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".
>>>> Tue Apr 26 21:01:16 2011 [DiM][I]: New VM state is DONE
>>>>
>>>>
>>>>
>>>> Isn't the image supposed to be registered during the save process.
>>>> 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.
>>>>
>>>> Please advice.
>>>>
>>>> Prakhar
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opennebula.org
>>>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Daniel Molina, Cloud Technology Engineer/Researcher
>>> Major Contributor
>>> OpenNebula - The Open Source Toolkit for Cloud Computing
>>> www.OpenNebula.org | dmolina at opennebula.org
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110429/40e259e1/attachment-0003.htm>


More information about the Users mailing list