qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to stop QEMU punching holes in backing store


From: Justin
Subject: How to stop QEMU punching holes in backing store
Date: Wed, 05 Jun 2024 07:19:51 -0700
User-agent: s-nail v14.9.11

Hi. I'm using QEMU emulator version 5.2.0 on Linux. I am using
thick-provisioned RAW files as the VM backing store. I've found that
QEMU is punching holes in my RAW files (it's replacing some zero
blocks with holes), which means that the number of blocks allocated to
the VM volumes decreases. It keeps doing this; I've manually used
fallocate(1) to reallocate the full number of blocks to the VM backing
store files, and sometime later QEMU punches some more holes.

How do I completely disable all hole punching?

The problem with this behavious is that this confuses capacity
management software into thinking that there is enough free space to
create more VMs. The file-system for the VM backing stores becomes
over-committed. Later, when a VM starts writing non-zero data to the
holes, the VM hangs because QEMU cannot write to the backing store
because there are no free blocks available. There is no recovery other
than deleting files, so it basically means one or more VMs have to be
sacrificed for the greater good.

I've run strace and I see calls to fallocate with these flags:
FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE

I've tried passing these options: discard=off,detect-zeroes=off but
this does not help. This is the full set of relevant options I'm
using:

-drive file=/vms/vm0/drive,format=raw,if=virtio,discard=off,detect-zeroes=off



reply via email to

[Prev in Thread] Current Thread [Next in Thread]