<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Mar 7, 2018 at 12:18 AM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Previous versions:<br>
  v3: <a href="https://www.redhat.com/archives/libguestfs/2018-March/msg00000.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libguestfs/2018-March/msg00000.html</a><br>
  v2: <a href="https://www.redhat.com/archives/libguestfs/2018-February/msg00177.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libguestfs/2018-February/msg00177.html</a><br>
  v1: <a href="https://www.redhat.com/archives/libguestfs/2018-February/msg00139.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libguestfs/2018-February/msg00139.html</a><br>
<br>
This completely rethinks the approach taken by the previous patches.<br>
<br>
Instead of trying to involve qemu's curl driver, this uses a small<br>
Python 3 nbdkit plugin to interface between qemu and the oVirt server.<br>
<br>
The data path is:<br>
<br>
  qemu-img convert  ------->   nbdkit   ------->   oVirt imageio<br>
                      nbd                 https<br></blockquote><div><br></div><div>What is the advantage of this for raw files? Why not:</div><div><br></div><div>    v2v -> ovirt imageio?</div><div><br></div><div>And how qcow2 files will be handled? when I tried nbdkit few month ago</div><div>I could not make it handle qcow2 files. Maybe I had to write a plugin?</div><div><br></div><div>We considered using this flow when we download/upload images,</div><div>to support on-the-fly image conversion:</div><div><br></div><div>    raw file -> qemu-img convert -> nbdkit -> qcow2 stream -> imageio -> http client</div><div><br></div><div>And same for uploading, e.g. uploading qcow2 and writing raw image.</div><div> <br></div><div>If this is possible using nbdkit plugin, can we ruse the same plugin in</div><div>different applications, or we must implement the plugin in each application?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
There are two Python scripts included.  One is the nbdkit plugin.  The<br>
other creates the VM.  As with the previous patches, these scripts get<br>
embeded in virt-v2v at compile time, so effectively there is no API<br>
contract between virt-v2v & the Python code.<br>
<br>
With this patch series I am able to (mostly) successfully convert VMs<br>
from local disk to oVirt 4.2, with full end-to-end streaming.  There<br>
is some room for optimization -- in particular uploads are currently<br>
rather slow because we rely on qemu-img batching small requests into<br>
large ones which it doesn't do well, and instead the nbdkit plugin<br>
could batch small writes into larger ones.  Also I noticed (but only<br>
one time) that very long transfers would cause the oVirt ticket to<br>
expire, even though we were writing the whole time.<br></blockquote><div><br></div><div>On the host, the ticket is extended regularly, based on the activity.</div><div><br></div><div>On the proxy we currently have 3600 seconds timeout, and the ticket</div><div>is never extended. I think we should have the same mechanism as</div><div>we do on the host.</div><div><br></div><div>Nir</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There are still a few unresolved issues (see patch 3/3) so this is not<br>
quite ready to go upstream yet, but can still be reviewed.  Patches 1<br>
& 2 are the same as posted before.<br>
<br>
I did not yet test qcow2 uploads.  Those are "interestingly" different<br>
because qcow2 will require us to read from the remote oVirt server as<br>
well as just stream/write to it.  The pread method for that is written<br>
but has not been tested.<br>
<br>
Rich.<br>
<br>
_______________________________________________<br>
Libguestfs mailing list<br>
<a href="mailto:Libguestfs@redhat.com" target="_blank">Libguestfs@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libguestfs" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libguestfs</a><br>
</blockquote></div></div>