Hi Markus,

AFAIK, mkfs.xfs tries to discard all the blocks before formatting the device.
If you don't want it to do that, you can use the "-K     Do not attempt to discard blocks at mkfs time" option of mkfs.xfs.

In oVirt 4.1 we introduced the "Enable Discard" flag for a virtual machine's disk.
When enabled, qemu is configured to pass on live UNMAP SCSI commands from the guest to the underlying storage.
If you don't need live discarding, shutdown the VM and disable the "Enable Discard" option. That will cause qemu to ignore the live UNMAP SCSI commands coming from the guest and not pass it on to the underlying storage.
Note that this makes fstrim completely redundant, as the purpose of the command is to discard unused blocks under the given path.


Regards,
Idan

On Sat, Jun 17, 2017 at 1:25 AM, Markus Stockhausen <stockhausen@collogia.de> wrote:
Hi,

we just set up a new 4.1.2 OVirt cluster. It is a quite normal
HDD/XFS/NFS stack that worked quit well with 4.0 in the past. 
Inside the VMs we use XFS too.

To our surprise we observe abysmal high IO during mkfs.xfs 
and fstrim inside the VM. A simple example:

Step 1: Create 100G Thin disk
Result 1: Disk occupies ~10M on storage

Step 2: Format disk inside VM with mkfs.xfs
Result 2: Disk occupies 100G on storage

Changing the discard flag on the disk does not have any effect.

Am I missing something?

Best regards.

Markus

_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users