[sheepdog-users] qemu-img convert; vdi write and preallocation
Liu Yuan
namei.unix at gmail.com
Sun Mar 24 08:55:39 CET 2013
On 03/23/2013 04:02 AM, Valerio Pachera wrote:
> Hi, correct me if I'm wrong:
>
> 'qemu-img convert' will create a vdi with no preallocation.
> It doesn't matter if it's from a qcow2 or a raw file.
> There is no way to make it pre-allocated.
>
Actually there is way, but preallocation is not well documented.
$ qemu-img create -o size=100M,preallocation=full sheepdog:vdi
> 'collie vdi write' do not create the vdi.
> I create a not preallocated disk and, when collie writes on it, it
> will copy all the "space" form the file it reads from (also the empty
> space).
> There is no way to "free" the empty space allocated on a vdi.
>
> This is the vdi list from the cluster where I imported the 100G device
> (zimra_backup).
> There is also a previous "test" of 100M made by 'vdi write' form a file.
>
> Name Id Size Used Shared Creation time VDI id Copies Tag
> zimbra_backup 0 100 GB 100 GB 0.0 MB 2013-03-22 09:20
> 2e519 2
> test 0 100 MB 100 MB 0.0 MB 2013-03-22 08:21 7c2b25
> 2
> wheezy 0 10 GB 1.8 GB 0.0 MB 2013-03-20 17:02 9533ed
> 2
> squeeze 0 10 GB 292 MB 1.5 GB 2013-03-21 11:21 a34c73 2
>
The 'vdi write' isn't intelligent enough to detect all-zero chunks from
the file descriptor.
What we can do better is built-in this intelligent or add a new command
'vdi punch' similar to file systems 'punch hole' that punch zero chunks
from data store. Which one is better?
Thanks,
Yuan
More information about the sheepdog-users
mailing list