Oops, sorry, the "if" line should be negated:<div><br></div><div>wrong:</div><div><font face="courier new, monospace">-    if file -b $DST|grep -q "QCOW"; then</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace">good:</font></div><div><font face="courier new, monospace">+    if ! file -b $DST|grep -q "QCOW"; then</font></div><div><div><br></div><div>cheers,<br>Jaime</div>

<br><div class="gmail_quote">On Mon, Sep 10, 2012 at 3:57 PM, Jaime Melis <span dir="ltr"><<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello Anton,<div><br>I would do something like: <a href="http://pastie.org/4695814" target="_blank">http://pastie.org/4695814</a> (untested!!)</div><div><br></div><div>cheers,</div><div>Jaime</div><div class="HOEnZb"><div class="h5">

<div><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 3:33 PM, Anton Gulenko <span dir="ltr"><<a href="mailto:anton.gulenko@student.hpi.uni-potsdam.de" target="_blank">anton.gulenko@student.hpi.uni-potsdam.de</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Jaime,<br>
<br>
thank you for the quick reply.<br>
<br>
Thanks to your explanations, we have managed to get the whole process<br>
working as we wanted it to, without modifying the qcow2-scripts.<br>
<br>
But to achieve that, we had to manually convert our image to the<br>
qcow2-format before importing it into OpenNebula.<br>
Is there a way to get OpenNebula to do that conversion task<br>
automatically? E.g. it could detect, when a raw image is imported into<br>
a<br>
qcow2-datastore, and instead of simply copying the image, invoke the<br>
"qemu-img convert" command.<br>
<br>
Cheers,<br>
Anton<br>
<br>
<br>
2012/9/10 Jaime Melis <<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>>:<br>
<div><div>> Hello Anton,<br>
><br>
> The qcow2 drivers assume, like with shared, that the datastore is exported<br>
> to the host using a distrubuted file system like NFS.<br>
><br>
> Considering we're talking about persistent images, why bother doing<br>
> "qemu-img create" and then "qemu-img commit" to save the changes, if you can<br>
> just do "ln -s" and use the image in place? It will be deployed faster,<br>
> saved faster and more importantly, it will run faster since it won't have a<br>
> backing-store.<br>
><br>
> Since the datastore is exported to the host, the MVDS script is doing<br>
> "qemu-img convert" only when the image has been marked as SAVE_AS, otherwise<br>
> it silently exits. For the SAVE_AS case, we want a new, indepedent image, so<br>
> we need to use "qemu-img convert".<br>
><br>
> Another thing we wanted to avoid was to have images depending on other<br>
> images. Consider the case where image A is the backing-store of image B. If<br>
> you remove image A, image B will stop working.<br>
><br>
> cheers,<br>
> Jaime<br>
><br>
> On Sun, Sep 9, 2012 at 10:13 PM, Anton Gulenko<br>
> <<a href="mailto:anton.gulenko@student.hpi.uni-potsdam.de" target="_blank">anton.gulenko@student.hpi.uni-potsdam.de</a>> wrote:<br>
>><br>
>> Dear OpenNebula community,<br>
>><br>
>> We are using OpenNebula 3.6 to set up a private cloud for a university<br>
>> research project.<br>
>> We use the FileSystem Datastore Manager and the qcow2 Transfer Manager.<br>
>> For the preparation of VMs, it is important for us to use persistent<br>
>> images.<br>
>> Using non-persistent images posed no problems at all. However,<br>
>> persistent deploying a VM with a persistent image would not work.<br>
>><br>
>> Inspecting the scripts in the $ONE_LOCATION/var/remotes/tm/qcow2<br>
>> directory, we noticed, that persistent images are handled the same way<br>
>> as by the Shared Transfer Manager: by creating a filesystem-link from<br>
>> the image-datastore into the System-datastore.<br>
>> Is that really the intention of the ln-script in the qcow2 Transfer<br>
>> Manager? We had expected a 'qemu-img create' command.<br>
>> We also noticed, that the mvds-script, that is responsible for<br>
>> committing the changes of the VM-disk back into the datastore, is<br>
>> using the 'qemu-img convert' command.<br>
>> We expected it to use the 'qemu-img commit' command, so that the<br>
>> changes are pushed back into the backing image-file.<br>
>><br>
>> Did we misunderstand the purpose of the mentioned scripts?<br>
>><br>
>> By making the following changes to the scripts, we got the qcow2<br>
>> Transfer Manager running just the way we expected it to:<br>
>> - Delete the original ln-script and replace it with a copy of the<br>
>> clone-script<br>
>> - Replace the 'qemu-img convert' command in the mvds-script with an<br>
>> appropriate 'qemu-img commit' command<br>
>><br>
>> Best regards,<br>
>> Anton and Frank<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>
><br>
><br>
><br>
><br>
> --<br>
> Jaime Melis<br>
> Project Engineer<br>
> OpenNebula - The Open Source Toolkit for Cloud Computing<br>
> <a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jaime Melis<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Cloud Computing<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a><br>



</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jaime Melis<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Cloud Computing<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a><br>


</div>