TRIM/discard response

Just curious, but does having my OS issue discards/trim/etc have any impact on the substrate underneath the vm?

I'm just curious if being diligent about issuing discards is in any way helpful for the infrastructure.

8 Replies

Linode doesn't use SSD so no.

Also, the 'disks' on your VM are just files on the underlying host filesystem.

@pclissold:

Also, the 'disks' on your VM are just files on the underlying host filesystem.
Is that actually the case? While I don't have any specific knowledge either way, for my part I always assumed that the guest block devices were implemented as logical volumes (probably via lvm) on top of the RAID array made out of physical devices and/or partitions on the host. So not based on actual files in the host's own filesystem, although obviously the host has access to the device(s) backing the guests.

– David

@db3l:

… I always assumed that the guest block devices were implemented as logical volumes (probably via lvm) on top of the RAID array made out of physical devices and/or partitions on the host. So not based on actual files in the host's own filesystem, although obviously the host has access to the device(s) backing the guests.

Yes, I believe your explanation is correct. My answer was quick, over simplified and wrong.

Well, an LV is still a file if you look at it in a certain manner :-)

Well, now that linode does use SSD, do we need to explicitely handle the trim/discard issue ourselves or is it performed at a lower level?

On my physical servers with SSD I just call daily a "fstrim /" in the root crontab.

However, on my newly created linode (Debian 8 + latest 64bit kernel, that I assume is on SSD), I get:

fstrim /

fstrim: /: the discard operation is not supported

lsblk -D

NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO

xvda 0 0B 0B 0

xvdb 0 0B 0B 0

Am I correct in thinking that linodes uses SSDs physically but we do not see them as such? so we do not need to handle trim/discard ourselves.

@colas:

Am I correct in thinking that linodes uses SSDs physically but we do not see them as such? so we do not need to handle trim/discard ourselves.

I would presume that's correct. There's a RAID controller and a Xen hypervisor between your linode and the SSD, you see a logical disk.

The TRIM could usefully be passed through (with LBA translation) to the virtual io to the raid, and then to the SSD drive. However, the error indicates that the passthrough is not currently supported.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct