[pve-devel] Qemu-img thin provision

Dietmar Maurer dietmar at proxmox.com
Sat Sep 26 10:20:20 CEST 2015


Hi Gilberto,

first, please do not send private mail. (use the mailing list instead)

> On September 25, 2015 at 10:26 PM Gilberto Nunes <gilberto.nunes32 at gmail.com>
> wrote:
> 
> 
> Hi Dietmar
> 
> Is there any file or script where I can change to deploy such feature?
> I meant, Proxmox must call some command to create VM file by qemu-img...
> If you can point me the path, perhaps aI can change it by myself...
> 

for example:

diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 6a1d6b6..bf98342 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -567,7 +567,8 @@ sub alloc_image {
     } else {
        my $cmd = ['/usr/bin/qemu-img', 'create'];

-       push @$cmd, '-o', 'preallocation=metadata' if $fmt eq 'qcow2';
+       push @$cmd, '-o', 'preallocation=metadata'
+           if ($fmt eq 'qcow2') && ($size < 200*1024*1024);

        push @$cmd, '-f', $fmt, $path, "${size}K";




More information about the pve-devel mailing list