How to prevent QCOW2 files from growing

TomTomGo

Renowned Member
Mar 30, 2012
48
3
73
France
Hello everyboy,

I'm playing with QCOW2 files / qm snapshot feature for our VMs and i've noticed that some QCOW2 files can became bigger than the VM HDD defined size.

For example, VM 202 with a 60Gb QCOW2 HDD :

Code:
qemu-img info /mnt/pve/nas20/images/202/vm-202-disk-1.qcow2
image: /mnt/pve/nas20/images/202/vm-202-disk-1.qcow2
file format: qcow2
virtual size: 60G (64424509440 bytes)
disk size: 62G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false

After shrinking with the wiki method, no problem, the file goes to 19G :

Code:
qemu-img info /mnt/pve/nas20/images/202/vm-202-disk-1.qcow2
image: /mnt/pve/nas20/images/202/vm-202-disk-1.qcow2
file format: qcow2
virtual size: 60G (64424509440 bytes)
disk size: 19G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false

Is there a way to prevent QCOW2 files from growing, especially when using qm snapshots ?
Is it possible to store the snapshot in a separate file, and merge it to the main file when deleting, like on ESXi ?

Regards,

Thomas
 
Hi,

>>Is there a way to prevent QCOW2 files from growing, especially when using qm snapshots ?
No, this is the nature of snapshot. When you take snapshot, new writes will increase size.

>>Is it possible to store the snapshot in a separate file, and merge it to the main file when deleting, like on ESXi ?

No, currently proxmox use only qcow2 internal snapshots.
 
Hi,

>>Is there a way to prevent QCOW2 files from growing, especially when using qm snapshots ?
No, this is the nature of snapshot. When you take snapshot, new writes will increase size.

>>Is it possible to store the snapshot in a separate file, and merge it to the main file when deleting, like on ESXi ?

No, currently proxmox use only qcow2 internal snapshots.

Okay thanks for the reply.
This is problematic in a production environment because if qcow2 files grows over their designed size, this could fill the DATASTORE (like doing thin provisionning) ...
Is there any plan to use qcow2 external snapshots ?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!