VE Guest VM Unable to Discard

Keyninja

Well-Known Member
Apr 15, 2019
19
34
53
29
Hi everyone,

I have a guest VM which seems to be unable to utilize the discard option to free up block space. The guest VM is a Ubuntu 18.04 LTS OS with an ext4 root FS. Underlying storage is Ceph on Bluestore OSDs. VM storage controller is VirtIO-SCSI, with just a standard 1TB disk attached to it. I have the discard box checked on the disk, but attempting to run "fstrim -v /" returns a: "the discard operation is not supported".

Any ideas here guys? VE is fully updated, it just won't do discard for some reason.

Thanks all,
 
What is the disk-type of the VM?
Iirc discard/trim is only working for SCSI disks.
 
What is the disk-type of the VM?
Iirc discard/trim is only working for SCSI disks.
That actually pointed me in the right direction! I stopped the VM, detached the disk from it, and found the disk itself was a VirtIO-Block device. I changed it to SCSI and re-attached it to the VM, so my current config is a VirtIO-SCSI controller with a SCSI disk, and fstrim/discard now seems to work! Thanks for pointing me in the right direction, that seemed to fix it!