<div dir="ltr"><div dir="ltr">I posted this patch for vdsm, adding NBD APIs:<div><a href="https://gerrit.ovirt.org/c/96079/">https://gerrit.ovirt.org/c/96079/</a><br></div><div><br></div><div>The main purpose of these APIs are enabling incremental restore, but they also</div><div>enable a more efficient rhv-upload via NBD, and importing to thin disks, which is</div><div>not possible with current solution.</div><div><br></div><div>The same idea can work for KubeVirt or other targets, minimizing specific</div><div>target code.</div><div><br></div><div>Here is how rhv-upload can work using NBD:</div><div><br></div><div>1. rhv-upload plugin separated to pre and post scripts</div><div><br></div><div>- pre - prepare disk and start image transfer</div><div>- post - finialize image transfer, create vm, etc.</div><div><br></div><div>2. rhr-upload-pre plugin create a transfer with transport="nbd"</div><div><br></div><div><div>POST /imagetransfers</div><div><br></div><div><image_transfer></div><div>    <disk id="123"/></div><div>    <direction>upload</direction></div><div>    <format>raw</format></div><div>    <transport>nbd</transport></div><div></image_transfer></div></div><div><br></div><div>Engine does not implement <transport> yet, but this should be an easy change.</div><div><br></div><div>This will use the new NBD APIs to export the disk using NBD over unix socket.</div><div>We can support later also NBD over TLS/PSK.</div><div><br></div><div>Engine will return NBD url in transfer_url:</div><div><br></div><div>    <transfer_url>nbd:unix:/run/vdsm/nbd/<transfer_uuid>.sock</tansfer_url></div><div><br></div><div>3. v2v use the trasfer_url to start qem-img with the NBD server:</div><div><br></div><div><div>    nbdkit (vddk) -> qemu-img convert -> qemu-nbd</div><br class="gmail-Apple-interchange-newline"></div><div><div>Note that nbdkit is removed from the rhv side of the pipeline. This is expected to </div><div>improve the throughput significantly, since imageio is not very good with lot of </div><div>small requests generated by qemu-img.</div><div><br></div><div>4. rhv-upload-post script invoked to complete the transfer</div><div><br></div><div>What do you think?</div><div><br></div><div>Nir</div><br class="gmail-Apple-interchange-newline"></div><br class="gmail-Apple-interchange-newline"></div></div>