<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 5:48 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">On Tue, May 17, 2016 at 03:41:53PM +0100, Richard W.M. Jones wrote:<br>
> On Tue, May 17, 2016 at 05:15:57PM +0300, Yaniv Kaul wrote:<br>
> > When creating qcow2 images using virt-builder, is there a way to specify<br>
> > the qcow2 preallocation, as possible with qemu-img create -o<br>
> > preallocation=metada , for example?<br>
><br>
> No .. but .. it does default to preallocation=metadata provided that<br>
> the output format is qcow2:<br>
><br>
> <a href="https://github.com/libguestfs/libguestfs/blob/master/builder/builder.ml#L582-L585" rel="noreferrer" target="_blank">https://github.com/libguestfs/libguestfs/blob/master/builder/builder.ml#L582-L585</a><br>
<br>
</span>I should say this only applies when the image needs to be resized<br>
(ie. you supply a --size parameter which != the size of the template),<br>
AND if the resize is the final step that the planner comes up with.<br>
<br>
<a href="https://rwmj.wordpress.com/2013/12/14/writing-a-planner-to-solve-a-tricky-programming-optimization-problem/" rel="noreferrer" target="_blank">https://rwmj.wordpress.com/2013/12/14/writing-a-planner-to-solve-a-tricky-programming-optimization-problem/</a></blockquote><div><br></div><div>Oh. I don't think there[1] is any need to resize in the code, it's just directly using the templates virt-builder uses, AFAIK.</div><div>Y.</div><div><br></div><div>[1] <a href="https://github.com/lago-project/lago-images/blob/inital-setup/bin/build.py">https://github.com/lago-project/lago-images/blob/inital-setup/bin/build.py</a> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
<br>
In the general case implementing this is more complicated.  I think it<br>
would require another planner transition.<br>
<span class=""><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
</span>virt-top is 'top' for virtual machines.  Tiny program with many<br>
powerful monitoring features, net stats, disk stats, logging, etc.<br>
<a href="http://people.redhat.com/~rjones/virt-top" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones/virt-top</a><br>
</blockquote></div><br></div></div>