On Thu, Sep 26, 2019 at 09:29:46AM -0500, Jonathan Wright wrote:
virt-sparsify: error: libguestfs error: discard cannot be enabled on
this
drive: qemu does not support discard for '*parallels*' format files
Since Virtuozzo 7.0.11 discard is officially supported for ploop images and
I've mounted them with discard and confirmed this functionality works as
expected. Would it be possible to update libguestfs to be aware of this
support so the --inplace flag will work?
libguestfs does its work by attaching the image to a virtual machine
running in QEMU. So the ability of libguestfs to sparsify an image
depends on the QEMU driver for that image format to support discard.
Current parallels format driver in QEMU doesn't support it, and I'm
unaware of anyone working on it.
https://virtuozzosupport.force.com/s/article/VZA-2019-059
"Native discard support in ploop enabling automatic discard requests on all
ext4 filesystems over ploop block devices, except containers running on
Virtuozzo Storage."
This refers to ploop block device driver in Virtuozzo kernel. It allows
to present a parallels format image as a block device (similar to what
traditional loop devices do with raw images).
The feature you quote is that this driver gained the ability to handle
discard requests to the ploop device by punching holes in the underlying
image.
So in order to achieve the same effect as virt-sparsify, you need to
mount the image and call fstrim on the mountpoint.
Roman.