Hello,
I am testing the meaning of discard-zeroes qemu's option, and from I've read it should detect that a bunch of zeroes are being written, and instead of writing zeros to the backend storage, discard/trim.
Is this the way it is supposed to work? Detect zeroes and discard them instead of writing them?
I have tried that but when writing zeroes to the virtual machine, the backend storage (ceph) stores zeroes instead of trimming. If I later within vm do a blkdiscard then the space where zeroes are written is discarded.
rbd du pool/vm-101-disk-1:
empty:
NAME PROVISIONED USED
vm-101-disk-1 9GiB 24MiB
after dd if=/dev/zero of=/dev/sdb1 bs=4M (64MiB partition)
NAME PROVISIONED USED
vm-101-disk-1 9GiB 88MiB
blkdiscard /dev/sdb1:
NAME PROVISIONED USED
vm-101-disk-1 9GiB 28MiB
I am testing the meaning of discard-zeroes qemu's option, and from I've read it should detect that a bunch of zeroes are being written, and instead of writing zeros to the backend storage, discard/trim.
Is this the way it is supposed to work? Detect zeroes and discard them instead of writing them?
I have tried that but when writing zeroes to the virtual machine, the backend storage (ceph) stores zeroes instead of trimming. If I later within vm do a blkdiscard then the space where zeroes are written is discarded.
rbd du pool/vm-101-disk-1:
empty:
NAME PROVISIONED USED
vm-101-disk-1 9GiB 24MiB
after dd if=/dev/zero of=/dev/sdb1 bs=4M (64MiB partition)
NAME PROVISIONED USED
vm-101-disk-1 9GiB 88MiB
blkdiscard /dev/sdb1:
NAME PROVISIONED USED
vm-101-disk-1 9GiB 28MiB