Hi Marco,<div><br></div><div>After a *graceful* shutdown, the disk images marked to be saved are transferred back from var/<vm_id>/images/XX to <meta charset="utf-8">var/<vm_id>/disk.XX</div><div><br></div><div>
Try using 'onevm shutdown' instead of delete, that will probably solve your problem.</div><div><br></div><div>Regards.<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, Engineer, 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">2011/2/10 Marco Strutz <span dir="ltr"><<a href="mailto:marco.strutz@desy.de">marco.strutz@desy.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi Carlos.<br>
<br>
Very strange: After running ttylinux and enabling the saveas-feature
('onevm saveas 318 0 "318_archived"') I get the following error
message (vm.log) after deleting this instance:<br>
Thu Feb 10 12:24:31 2011 [VMM][W]: Ignored: CANCEL SUCCESS 318
Domain one-318 destroyed<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: Command execution fail:
/srv/cloud/one/share/hooks/image.rb 318<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: STDERR follows.<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: ExitCode: 255<br>
Thu Feb 10 12:24:31 2011 [HKM][E]: Error executing Hook: image.<br>
<br>
After debugging $ONE_LOCATION/share/hooks/image.rb there might be a
problem with the proper image location:<br>
line 75 in $ONE_LOCATION/share/hooks/image.rb (result =
img_repo.update_source(image, source_path) outputs<br>
"No such file or directory - /srv/cloud/one/var/318/disk.0 or
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12"<br>
<br>
All disk images of my vm's are deployed to
$ONE_LOCATION/var/<vm_id>/images/<br>
If I get the error message right, it tries to lookup for the disks
in $ONE_LOCATION/var/<vm_id>/<br>
<br>
I need your help. Can that be right? <br>
<br>
(detailed logs see below)<br>
<br>
<br>
Thanks in advance<br>
Marco<br>
<br>
<br>
<br>
<br>
$ cat ttylinux.one <br>
###############################################################################<br>
NAME = ttylinux<br>
CPU = 0.1<br>
MEMORY = 64<br>
<br>
DISK = [<br>
source = "/srv/cloud/one/testing/ttylinux.img",<br>
target = "hda",<br>
readonly = "no" ]<br>
<br>
FEATURES=[ acpi="no" ]<br>
<br>
GRAPHICS = [<br>
type = "vnc",<br>
listen = "0.0.0.0",<br>
port = "5901" ]<br>
<br>
<br>
<br>
$ onevm create ttylinux.one <br>
###############################################################################<br>
<br>
<br>
<br>
$ onevm list<br>
###############################################################################<br>
ID USER NAME STAT CPU MEM HOSTNAME TIME<br>
318 oneadmin ttylinux runn 0 0K testbed07 00 00:00:08<br>
<br>
<br>
<br>
$ onevm show 318<br>
###############################################################################<br>
VIRTUAL MACHINE 318
INFORMATION <br>
ID : 318 <br>
NAME : ttylinux <br>
STATE : ACTIVE <br>
LCM_STATE : RUNNING <br>
START TIME : 02/10 12:20:34 <br>
END TIME : - <br>
DEPLOY ID: : one-318 <br>
<br>
VIRTUAL MACHINE
MONITORING <br>
NET_TX : 0 <br>
NET_RX : 0 <br>
USED MEMORY : 0 <br>
USED CPU : 0 <br>
<br>
VIRTUAL MACHINE
TEMPLATE <br>
CPU=0.1<br>
DISK=[<br>
DISK_ID=0,<br>
READONLY=no,<br>
SOURCE=/srv/cloud/one/testing/ttylinux.img,<br>
TARGET=hda ]<br>
FEATURES=[<br>
ACPI=no ]<br>
GRAPHICS=[<br>
LISTEN=0.0.0.0,<br>
PORT=5901,<br>
TYPE=vnc ]<br>
MEMORY=64<br>
NAME=ttylinux<br>
VMID=318<br>
<br>
<br>
<br>
$ ls -la var/318/<br>
###############################################################################<br>
total 24<br>
drwxrwxrwx 3 oneadmin cloud 75 2011-02-10 12:20 .<br>
drwxr-xr-x 323 oneadmin cloud 8192 2011-02-10 12:20 ..<br>
-rw-r--r-- 1 oneadmin cloud 416 2011-02-10 12:20 deployment.0<br>
drwxrwxrwx 2 oneadmin cloud 38 2011-02-10 12:20 images<br>
-rw-r--r-- 1 oneadmin cloud 104 2011-02-10 12:20
transfer.0.prolog<br>
-rw-r--r-- 1 oneadmin cloud 1266 2011-02-10 12:20 vm.log<br>
$ ls -la var/318/images/<br>
total 40964<br>
drwxrwxrwx 2 oneadmin cloud 38 2011-02-10 12:20 .<br>
drwxrwxrwx 3 oneadmin cloud 75 2011-02-10 12:20 ..<br>
-rw-r--r-- 1 oneadmin cloud 416 2011-02-10 12:20 deployment.0<br>
-rw-rw-rw- 1 oneadmin cloud 41943040 2011-02-10 12:21 disk.0<br>
<br>
<br>
<br>
$ onevm saveas 318 0 "318_archived"<br>
###############################################################################<br>
<br>
<br>
<br>
$ onevm show 318<br>
###############################################################################<br>
VIRTUAL MACHINE 318
INFORMATION <br>
ID : 318 <br>
NAME : ttylinux <br>
STATE : ACTIVE <br>
LCM_STATE : RUNNING <br>
START TIME : 02/10 12:20:34 <br>
END TIME : - <br>
DEPLOY ID: : one-318 <br>
<br>
VIRTUAL MACHINE
MONITORING <br>
NET_TX : 0 <br>
NET_RX : 0 <br>
USED MEMORY : 0 <br>
USED CPU : 0 <br>
<br>
VIRTUAL MACHINE
TEMPLATE <br>
CPU=0.1<br>
DISK=[<br>
DISK_ID=0,<br>
READONLY=no,<br>
SAVE=YES,<br>
SAVE_AS=37,<br>
SOURCE=/srv/cloud/one/testing/ttylinux.img,<br>
TARGET=hda ]<br>
FEATURES=[<br>
ACPI=no ]<br>
GRAPHICS=[<br>
LISTEN=0.0.0.0,<br>
PORT=5901,<br>
TYPE=vnc ]<br>
MEMORY=64<br>
NAME=ttylinux<br>
VMID=318<br>
<br>
<br>
<br>
$ oneimage show 37<br>
###############################################################################<br>
IMAGE
INFORMATION
<br>
ID : 37 <br>
NAME : 318_archived <br>
TYPE : OS <br>
REGISTER TIME : 02/10 12:22:50 <br>
PUBLIC : No <br>
PERSISTENT : No <br>
SOURCE :
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12<br>
STATE : disa <br>
RUNNING_VMS : 0 <br>
<br>
IMAGE
TEMPLATE
<br>
DEV_PREFIX=hd<br>
NAME=318_archived<br>
<br>
<br>
<br>
$ ls -la
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12<br>
###############################################################################<br>
ls: cannot access
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12:
No such file or directory<br>
<br>
<br>
<br>
$ onevm delete 318<br>
###############################################################################<br>
<br>
<br>
$ onevm list<br>
###############################################################################<br>
ID USER NAME STAT CPU MEM HOSTNAME TIME<br>
<br>
<br>
$ oneimage show 37<br>
###############################################################################<br>
IMAGE
INFORMATION
<br>
ID : 37 <br>
NAME : 318_archived <br>
TYPE : OS <br>
REGISTER TIME : 02/10 12:22:50 <br>
PUBLIC : No <br>
PERSISTENT : No <br>
SOURCE :
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12<br>
STATE : rdy <br>
RUNNING_VMS : 0 <br>
<br>
IMAGE
TEMPLATE
<br>
DEV_PREFIX=hd<br>
NAME=318_archived<br>
<br>
<br>
<br>
$ ls -la
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12<br>
###############################################################################<br>
ls: cannot access
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12:
No such file or directory<br>
<br>
<br>
<br>
$ cat $ONE_LOCATION/var/318/vm.log <br>
###############################################################################<br>
Thu Feb 10 12:20:36 2011 [DiM][I]: New VM state is ACTIVE.<br>
Thu Feb 10 12:20:36 2011 [LCM][I]: New VM state is PROLOG.<br>
Thu Feb 10 12:20:36 2011 [VM][I]: Virtual Machine has no context<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh:
testbed00:/srv/cloud/one/testing/ttylinux.img
testbed07:/srv/cloud/one/var//318/images/disk.0<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: DST:
/srv/cloud/one/var//318/images/disk.0<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Creating directory
/srv/cloud/one/var//318/images<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Executed "mkdir -p
/srv/cloud/one/var//318/images".<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Executed "chmod a+w
/srv/cloud/one/var//318/images".<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Cloning
/srv/cloud/one/testing/ttylinux.img<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Executed "cp -r
/srv/cloud/one/testing/ttylinux.img
/srv/cloud/one/var//318/images/disk.0".<br>
Thu Feb 10 12:20:36 2011 [TM][I]: tm_clone.sh: Executed "chmod a+rw
/srv/cloud/one/var//318/images/disk.0".<br>
Thu Feb 10 12:20:36 2011 [LCM][I]: New VM state is BOOT<br>
Thu Feb 10 12:20:36 2011 [VMM][I]: Generating deployment file:
/srv/cloud/one/var/318/deployment.0<br>
Thu Feb 10 12:20:37 2011 [LCM][I]: New VM state is RUNNING<br>
Thu Feb 10 12:24:31 2011 [VMM][W]: Ignored: LOG - 318 Driver command
for 318 cancelled<br>
<br>
Thu Feb 10 12:24:31 2011 [DiM][I]: New VM state is DONE<br>
Thu Feb 10 12:24:31 2011 [TM][W]: Ignored: LOG - 318 tm_delete.sh:
Deleting /srv/cloud/one/var//318/images<br>
<br>
Thu Feb 10 12:24:31 2011 [TM][W]: Ignored: LOG - 318 tm_delete.sh:
Executed "rm -rf /srv/cloud/one/var//318/images".<br>
<br>
Thu Feb 10 12:24:31 2011 [TM][W]: Ignored: TRANSFER SUCCESS 318 -<br>
<br>
Thu Feb 10 12:24:31 2011 [VMM][W]: Ignored: CANCEL SUCCESS 318
Domain one-318 destroyed<br>
<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: Command execution fail:
/srv/cloud/one/share/hooks/image.rb 318<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: STDERR follows.<br>
Thu Feb 10 12:24:31 2011 [HKM][I]: ExitCode: 255<br>
Thu Feb 10 12:24:31 2011 [HKM][E]: Error executing Hook: image.<br>
<br>
<br>
<br>
<br>
line 75 in $ONE_LOCATION/share/hooks/image.rb (result =
img_repo.update_source(image, source_path) outputs<br>
###############################################################################<br>
"No such file or directory - /srv/cloud/one/var/318/disk.0 or
/srv/cloud/one/var//images/7c6f81fcb5b4dec12ab3fa63913b16b4ba1e2d12"<br>
<br>
<br>
<br>
<br>
On 02/10/2011 10:11 AM, Marco Strutz wrote:
<blockquote type="cite">
Hi.<br>
<br>
Thanks Carlos! I have managed to reproduce the behaviour by xmlrpc
calls.<br>
But for the long term it would be very handy to access the
"saveas" feature in one single xmlrpc call too so that it won't be
necessary to duplicate (onevm ruby) source code and validate it
for each new Opennebula release.<br>
<br>
<br>
regards<br>
Marco<br>
<br>
On 02/09/2011 11:20 AM, Carlos Martín Sánchez wrote:
<blockquote type="cite">Hi Marco,
<div><br>
</div>
<div>The XML-RPC call requests an image id because the image has
to be created beforehand.</div>
<div>You can check how it is done in the oneimage command (it's
a straight forward ruby script), and then replicate the same
steps in your code.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Carlos.</div>
<div><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial,sans-serif;font-size:13px">--<br>
Carlos Martín, Engineer, MSc<br>
Project Major Contributor<br>
<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34)">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)">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)">opennebula</span>.org</a></span><br>
<br>
<br>
<div class="gmail_quote">On 8 February 2011 17:03, Marco
Strutz <span dir="ltr"><<a href="mailto:marco.strutz@desy.de" target="_blank">marco.strutz@desy.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"> Hello.<br>
<br>
What is the best way to map the "onevm saveas" command [1]
to OCCI or<br>
XMLRPC-Request? I need to save vm images but want to avoid
using the<br>
command line interface.<br>
<br>
I cannot simply use the xmlrpc-call "one.vm.savedisk" [2]
since I then<br>
would need to know the "image id where the disk will be
saved". But this<br>
ID will be dynamically created by the "onevm saveas"
command, right?<br>
Furthermore where should I place the <image_name> in
the XMLRPC-call?<br>
The same problem with OCCI: Are there any attributes
(perhaps for the<br>
<CONTEXTUALISATION> section) I can use for the
"onevm saveas"?<br>
<br>
<br>
<br>
Thanks<br>
Marco<br>
<br>
<br>
[1]<br>
onevm saveas <vm_id> <disk_id>
<image_name><br>
<br>
<br>
[2]<br>
one.vm.savedisk<br>
****************<br>
Type Data Type Description<br>
IN String the session string associated to the
connected user. * *<br>
IN Int the virtual machine Id (vid) of the
instance.<br>
IN Int disk id of the disk we want to save.<br>
IN Int image id where the disk will be saved.<br>
OUT Boolean true or false whenever is successful
or not<br>
OUT String if an error occurs this is error
message, otherwise<br>
it does not exist.<br>
_______________________________________________<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>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>