<div dir="auto">I'm thinking on how to prove you a sample XVA<div dir="auto">I have to create (and populate) a VM because an empty image will result in an empty XVA</div><div dir="auto">And a VM is 300-400Mb as minimum</div></div><div class="gmail_extra"><br><div class="gmail_quote">Il 15 nov 2017 10:30 PM, "Max Reitz" <<a href="mailto:mreitz@redhat.com">mreitz@redhat.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2017-11-15 21:41, Gandalf Corvotempesta wrote:<br>
> 2017-11-15 21:29 GMT+01:00 Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>>:<br>
>> Gandalf, is there an XVA file publically available (pref. not<br>
>> too big) that we can look at?<br>
><br>
> I can try to provide one, but it's simple:<br>
><br>
> # tar tvf 20160630_124823_aa72_.xva.gz | head -n 50<br>
> ---------- 0/0           42353 1970-01-01 01:00 ova.xml<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000000<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000000.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000001<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000001.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000003<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000003.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000004<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000004.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000005<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000005.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000006<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000006.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000007<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000007.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000009<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000009.checksum<br>
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000010<br>
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000010.checksum<br>
><br>
><br>
> You can ignore the ova.xml and just use the "Ref:175" directory.<br>
> Inside the XVA you'll fine one "Ref" directory for each virtual disk<br>
> (ref number is different for each disk)<br>
> Inside each Ref directory, you'll get tons of 1MB file, corrisponding<br>
> to the RAW image.<br>
> You have to merge these files in a single raw file with just an<br>
> exception: numbers are not sequential.<br>
> as you can see above, we have: 00000000, 00000001, 00000003<br>
><br>
> The 00000002 is missing, because it's totally blank. XenServer doesn't<br>
> export any empty block, thus it will skip the corrisponding 1MB file.<br>
> When building the raw image, you have to replace empty blocks with 1MB<br>
> full of zeros.<br>
><br>
> This is (in addition to the tar extract) the most time-consuming part.<br>
> Currently I'm rebuilding a 250GB image, with tons of files to be<br>
> merge.<br>
> If qemu-img can be patched to automatically convert this kind of<br>
> format, I can save about 3 hours (30 minutes for extracting the<br>
> tarball, and about 2 hours to merge 250-300GB image)<br>
<br>
Hmmm...  OK, so as Rich said, you can use the raw driver with an offset<br>
and a size.  And you can use the null-co driver to emulate holes.  And<br>
qemu-img convert supports concatenation.<br>
<br>
Taking all of that together, it should be possible to create an input<br>
"file" per 1 MB block and concatenate all of those with qemu-img<br>
convert.  The only issue is that it'll get you a *really* long command line.<br>
<br>
(And you'll still have to gunzip the archive before, of course.)<br>
<br>
I'll try to write a script, but of course it's hart without an example...<br>
<br>
Max<br>
<br>
</blockquote></div></div>