When creating new Linux virtual machines using recent (>= 2014) distributions in VMware ESXi 5.5, should they mount their filesystems with the discard option ?

I make the assumption that the VM's admin does not necessarily know what is the actual underlying storage and that the VM is using whatever is the recommended "virtual controller" and I hope/suspect that if the VM sends out TRIM commands they could be useful with thin virtual disks (even if they are on non-SSD storage) or with thick virtual disks on SSD storage.

Does the discard mount option actually do something when used in an ESXi VM (eg. even if the virtual controller is a SCSI one and not a SATA one) ?

Does vSphere >= 5.5 do anything when the VM uses such discard option?

  • There's no need to do this. Lots of layers of abstraction. – ewwhite Jun 21 '14 at 19:44
  • I'd rather say "it is currently useless to do this"... but if correctly implemented it would really useful (think about freeing thin disk blocks when VM sends out TRIM and/or propagate TRIM to underlying storage). – Luke404 Feb 8 '15 at 13:36

As far as I know ESXi doesn't make use of TRIM commands from a VM. I havn't found anything definite or official from VMware but in a comment to a blog post I found this:

In VMs TRIM is definetely not available, I already checked that.

FAQ: Using SSDs with ESXi

So it looks like mounting filesystems with the discard option won't help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.