Hi,
I optimize all my VMs to fill their free space with zeros before backup, such that the backup files are as small as possible and I do this semi-manually (scripted and cronjobed), but this is not automatic for me. I know that you can use discard, but only if the underlying storage supports it. I used it with qcow and even LVM on SSD, but I have a cluster and a FC-based SAN for my VMs.
The KVM manpages stated this:
What else is there? This does not apply to my problem. I want to clear/zeroize the blocks on LVM if the file is discarded in the VM.
I optimize all my VMs to fill their free space with zeros before backup, such that the backup files are as small as possible and I do this semi-manually (scripted and cronjobed), but this is not automatic for me. I know that you can use discard, but only if the underlying storage supports it. I used it with qcow and even LVM on SSD, but I have a cluster and a FC-based SAN for my VMs.
The KVM manpages stated this:
discard=discard
discard is one of "ignore" (or "off") or "unmap" (or "on") and controls whether discard (also known as trim or unmap) requests are ignored or passed to the filesystem. Some machine types may not support discard requests.
...
detect-zeroes=detect-zeroes
detect-zeroes is "off", "on" or "unmap" and enables the automatic conversion of plain zero writes by the OS to driver specific optimized zero write commands. You may even choose "unmap" if discard is set to "unmap" to allow a zero write to be converted to an UNMAP operation.
What else is there? This does not apply to my problem. I want to clear/zeroize the blocks on LVM if the file is discarded in the VM.