<div dir="ltr"><div><div><div>Eventually, the option of preallocated disk on NFS will not be available in oVirt.<br></div>The underlying file systems in NFS are usually implementing sparse file.<br>There might even be a file system implementation that will ignore those zeroes that we fill.<br><br></div>If you need a "real" preallocated disk, block storage will do the job for you.<br><br></div><div>Regards,<br><br></div><div>Fred<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 10:37 AM, Simon Barrett <span dir="ltr"><<a href="mailto:Simon.Barrett@tradingscreen.com" target="_blank">Simon.Barrett@tradingscreen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Many thanks for the information and it does explain what I’m seeing.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Is this the expected result though or is it a known bug? If using qemu-img to move images always results in a disk image that states it is preallocated but does
not allocate the space, how do I move preallocated disk images? I know I can do the same within the VM and write a very large file full of zeros to grow the image to full capacity on disk but is that the correct approach?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks again,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-2797009543800482168__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Fred Rolland [mailto:<a href="mailto:frolland@redhat.com" target="_blank">frolland@redhat.com</a>]
<br>
<b>Sent:</b> Sunday, 7 August, 2016 10:55<br>
<b>To:</b> Simon Barrett <<a href="mailto:Simon.Barrett@tradingscreen.com" target="_blank">Simon.Barrett@tradingscreen.<wbr>com</a>><br>
<b>Cc:</b> <a href="mailto:users@ovirt.org" target="_blank">users@ovirt.org</a><br>
<b>Subject:</b> Re: [ovirt-users] preallocated storage issue?<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Simon,<u></u><u></u></p>
</div>
<p class="MsoNormal">What is happening is that when we create a preallocated disk on NFS, we fill the file with zeros in order to "allocate" the space.<u></u><u></u></p>
</div>
<p class="MsoNormal">However, while copying the disk we use qemu-img that will ignore the zeros.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Quick way to demonstrate:<br>
<br>
[root@white-vdsd test]# dd if=/dev/zero of=myfile.txt bs=1M count=1<br>
1+0 records in<br>
1+0 records out<br>
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00172084 s, 609 MB/s<br>
<br>
[root@white-vdsd test]# du -h myfile.txt<br>
1.0M myfile.txt<br>
<br>
[root@white-vdsd test]# ls -lh myfile.txt<br>
-rw-r--r-- 1 root root 1.0M Aug 7 12:39 myfile.txt<br>
<br>
[root@white-vdsd test]# qemu-img convert myfile.txt myfile2.txt<br>
<br>
[root@white-vdsd test]# ls -lh myfile2.txt<br>
-rw-r--r-- 1 root root 1.0M Aug 7 12:41 myfile2.txt<br>
<br>
[root@white-vdsd test]# du -h myfile2.txt<br>
0 myfile2.txt<br>
<br>
[root@white-vdsd test]# qemu-img info myfile.txt<br>
image: myfile.txt<br>
file format: raw<br>
virtual size: 1.0M (1048576 bytes)<br>
disk size: 1.0M<br>
<br>
[root@white-vdsd test]# qemu-img info myfile2.txt<br>
image: myfile2.txt<br>
file format: raw<br>
virtual size: 1.0M (1048576 bytes)<br>
disk size: 0<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I hope this explains what you see.<u></u><u></u></p>
</div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<p class="MsoNormal">Fred<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Sun, Aug 7, 2016 at 11:13 AM, Simon Barrett <<a href="mailto:Simon.Barrett@tradingscreen.com" target="_blank">Simon.Barrett@tradingscreen.<wbr>com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p>Storage is NFS. What logs would you like to see?<u></u><u></u></p>
<p>Many thanks.<u></u><u></u></p>
<p><span style="color:#888888">Simon<u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On Sun, Aug 7, 2016 at 8:53 AM +0100, "Fred Rolland" <<a href="mailto:frolland@redhat.com" target="_blank">frolland@redhat.com</a>> wrote:<u></u><u></u></p>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Simon hi,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">What storage type are you using in source and target storage domains ? (NFS, ISCSI....)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Can you share the logs?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<p class="MsoNormal">Fred<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Aug 5, 2016 at 6:37 PM, Simon Barrett <<a href="mailto:Simon.Barrett@tradingscreen.com" target="_blank">Simon.Barrett@tradingscreen.<wbr>com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="color:#1f497d">Another example. This one was moved to a new storage domain</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">root@ovirt_host1> qemu-img info dd6f25f6-7830-4024-915f-<wbr>a20268797c34</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">image: dd6f25f6-7830-4024-915f-<wbr>a20268797c34</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">file format: raw</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">virtual size: 200G (214748364800 bytes)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">disk size: 5.0G</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">root@ ovirt_host1> cat dd6f25f6-7830-4024-915f-<wbr>a20268797c34.meta</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DOMAIN=53560d43-874a-49c5-<wbr>9c5a-8b90487c79f8</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">VOLTYPE=LEAF</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">CTIME=1470305678</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">FORMAT=RAW</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">IMAGE=741976cd-d1cb-4031-bdbe-<wbr>6a745dff16ef</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DISKTYPE=2</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">PUUID=00000000-0000-0000-0000-<wbr>000000000000</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">LEGALITY=LEGAL</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">MTIME=0</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">POOL_UUID=</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">SIZE=419430400</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">TYPE=PREALLOCATED</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DESCRIPTION=</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">EOF</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">This one has not been moved:</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><a href="mailto:root@ny2-lvb-066.mgt" target="_blank">root@ny2-lvb-066.mgt</a>> qemu-img info 155f0d33-c280-4236-8d1e-<wbr>fcb88f9a1242</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">image: 155f0d33-c280-4236-8d1e-<wbr>fcb88f9a1242</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">file format: raw</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">virtual size: 90G (96636764160 bytes)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">disk size: 90G</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><a href="mailto:root@ny2-lvb-066.mgt" target="_blank">root@ny2-lvb-066.mgt</a>> cat 155f0d33-c280-4236-8d1e-<wbr>fcb88f9a1242.meta</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DOMAIN=59bde2ff-e10d-477e-<wbr>91c1-6355abff0999</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">CTIME=1464946639</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">FORMAT=RAW</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DISKTYPE=2</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">LEGALITY=LEGAL</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">SIZE=188743680</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">VOLTYPE=LEAF</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">DESCRIPTION={"DiskAlias":"ny2-<wbr>laa-010.prod_Disk1","<wbr>DiskDescription":""}</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">IMAGE=82158182-81a4-458e-a41b-<wbr>663756962666</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">PUUID=00000000-0000-0000-0000-<wbr>000000000000</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">MTIME=0</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">POOL_UUID=</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">TYPE=PREALLOCATED</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">EOF</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">See the mismatch between “virtual size” and “disk size” on the one that was moved.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">TIA,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><a name="m_-2797009543800482168_m_4265245599051383173_m_-191340538698667"><span style="color:#1f497d"> </span></a><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b>
<a href="mailto:users-bounces@ovirt.org" target="_blank">users-bounces@ovirt.org</a> [mailto:<a href="mailto:users-bounces@ovirt.org" target="_blank">users-bounces@ovirt.<wbr>org</a>]
<b>On Behalf Of </b>Simon Barrett<br>
<b>Sent:</b> Friday, 5 August, 2016 10:25<br>
<b>To:</b> <a href="mailto:users@ovirt.org" target="_blank">users@ovirt.org</a><br>
<b>Subject:</b> [ovirt-users] preallocated storage issue?<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">If I create a preallocated disk for a VM, I see the disk image file listing as the size I requested (100G):<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">cd /rhev/data-center/mnt/storage_<wbr>host1:_vol_pa1__nas__01b__<wbr>oVirt__prod__01/53560d43-874a-<wbr>49c5-9c5a-8b90487c79f8/images/<wbr>d97f7706-3662-40bf-9358-<wbr>80e0dc51bff4</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">root@ovirt_host> ls -l</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">total 105064644</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-rw---- 1 vdsm kvm 107374182400 Aug 5 10:57 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-rw---- 1 vdsm kvm 1048576 Aug 5 10:57 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.lease</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-r--r-- 1 vdsm kvm 313 Aug 5 10:57 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.meta</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">and the corresponding space used on disk matches<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">root@ ovirt_host > du -sh *</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">101G 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">1.1M 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.lease</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">4.0K 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.meta</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">If I then migrate that storage (while the VM is shutdown) to a new storage domain, the size on disk does not match the allocated size. In this case there is nothing in the disk
yet so it shows as 0.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">cd /rhev/data-center/mnt/storage_<wbr>host2:_vol_pa1__ovirt__<wbr>uatprod/1f2c2b48-1e77-4c98-<wbr>a6da-5dc09b78cead/images/<wbr>d97f7706-3662-40bf-9358-<wbr>80e0dc51bff4</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">root@ ovirt_host> ls -l</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">total 1032</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-rw---- 1 vdsm kvm 107374182400 Aug 5 11:06 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-rw---- 1 vdsm kvm 1048576 Aug 5 11:06 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.lease</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">-rw-r--r-- 1 vdsm kvm 313 Aug 5 11:06 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.meta</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">root@ ovirt_host > du -sh *</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">0 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">1.1M 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.lease</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">4.0K 75c14559-e18f-4cc8-a3fe-<wbr>bc0de507720b.meta</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">oVirt still lists the disk as preallocated in the GUI but it is in fact thin provisioned.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I see the same issue if I clone a preallocated VM. The size on disk ends up being the equivalent of a thin-provisioned disk. I also had the issue when importing VM’s from an export
domain when I had selected preallocated in the import dialog box.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Is this a known issue? Should preallocated not mean preallocated on physical disk?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Ovirt Engine is running 3.6.4.1-1.el6<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The ovirt nodes are running:
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">OS Version: RHEL - 7 - 2.1511.el7.centos.2.10<u></u><u></u></p>
<p class="MsoNormal">Kernel Version: 3.10.0 - 327.4.5.el7.x86_64<u></u><u></u></p>
<p class="MsoNormal">KVM Version: 2.3.0 - 31.el7_2.7.1<u></u><u></u></p>
<p class="MsoNormal">LIBVIRT Version: libvirt-1.2.17-13.el7_2.2<u></u><u></u></p>
<p class="MsoNormal">VDSM Version: vdsm-4.17.23.2-0.el7.centos<u></u><u></u></p>
<p class="MsoNormal">SPICE Version: 0.12.4 - 15.el7<u></u><u></u></p>
<p class="MsoNormal">GlusterFS Version: [N/A]<u></u><u></u></p>
<p class="MsoNormal">CEPH Version: librbd1-0.80.7-3.el7<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Many thanks,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Simon<u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>