linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Expectations for TRIM on an MD→LVM→Xen→? stack
@ 2015-05-18 21:21 Andy Smith
  0 siblings, 0 replies; only message in thread
From: Andy Smith @ 2015-05-18 21:21 UTC (permalink / raw)
  To: linux-lvm

Hi,

This is a purely hypothetical setup at this point but I am wondering
what to expect in the way of TRIM support through all these layers.

Let's say: Debian 8.0 (jessie) host machine with SSDs in MD RAID-10,
MD device used as PV, and then Xen PV VMs using LVs as their disks.
I will have no idea how the administrators of the VMs will lay out
their storage; they might treat them as disks and partition them, or
directly put filesystems on the block devices, or even use them as
LVM PVs themselves.

As far as I can see:

- MD supports TRIM on RAID-10 from kernel 3.7:

  http://kernelnewbies.org/Linux_3.7#head-2fd9b183a4623d96e69ed24f88e0eb83217fa8df

- LVM supports TRIM if issue_discards is set:

  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lvmconf_file.html

- Xen supports TRIM on PV block device since kernel 3.2:

  http://wiki.xen.org/wiki/XenParavirtOps

So, I think the situation would be something like:

- If the admin of the VM sets it up to do TRIM by e.g. using the
  discard fstab option or issuing fstrim commands, then the TRIM
  commands should be passed all the way down and honoured.

- There will be nothing I as the operator of the bare metal machine
  can do to either force or deny TRIM for the underlying storage of
  those LVs other than to disable it in LVM. So if the VM admin does
  not configure TRIM, there will be no TRIM.

- Once a VM is decommissioned and an lvremove is done from the
  hypervisor host, we could expect TRIM to take place.

Are these assumptions correct?

If I ran blktrace on the MD member device (e.g. /dev/sda5), would I
see a TRIM command propagated down from a VM? What would that look
like?

Thanks,
Andy

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-18 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 21:21 [linux-lvm] Expectations for TRIM on an MD→LVM→Xen→? stack Andy Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).