The way OnApp's VM's work does not provide the possibility to use real thin provisioning because the removed files from the thin provisioned sectors are not actually marked as free on the storage end and they continue to keep it locked. That doesn't allow us to migrate all our shared servers to OnApp as lots of SSD space will be wasted due to OnApp not supporting the exposal of the DISCARD command to virtual machines.
There are many storage systems out there which provide a block device (e.g. /dev/sdc) on the host, which supports the DISCARD (aka ATA TRIM) command. These storage systems use the DISCARD command to reclaim space which is no longer used. This is supported by many storage systems using iSCSI and FC, including NetApp and HP/3PAR. It is also supported by storage systems using their own protocol to connect hypervisors, e.g. Ceph RBD and StorPool.
In order to use this functionality of SANs we need to be able to expose the DISCARD command to virtual machines. In QEMU/KVM this is achieved by selecting the virtio-scsi (rather than virtio-blk) virtual disk device/driver, and setting the discard=unmap option. Here is a good guide on the topic: http://dustymabe.com/2013/06/11/recover-space-from-vm-disk-images-by-using-discardfstrim/
To avoid confusion, this approach does not use LVM thin provisioning or thin-provisioned qcow2 images. It uses thin provisioning in the storage system and exposes the reclaim function of the SAN to the hypervisors and VMs. From QEMU/KVM the storage looks like a raw image.
Post is closed for comments.