Unclear on SSDs and TRIM support

drzoidberg33

New Member
Feb 11, 2014
20
0
1
I've been searching for information on using SSDs in virtual environments and there is a serious lack of clear information anywhere online.

I just need some advice on if this is something that I should consider.

Our setup is very basic, I just have a single node currently with 1 boot drive (containing Proxmox) and 1 data drive (where my images/containers reside). I want to replace both drives with SSDs - a small ADATA 64GB boot drive and a Samsung 850 Pro for the data drive (And yes I have daily backups).

How would I go about ensuring that TRIM support functions correctly in this setup? The only guest OSes I have installed are Centos 6 and Ubuntu CTs and one Windows Server 2008 R2 installation.

I'll be using LVM because I rely on snapshot backups. Don't know if that complicates things.

I haven't worked much with SSDs in the past, so assume I know nothing.

TIA.
 
Use virtio disk and virtio-scsi for controller. The virtio-scsi controller will pass-through the trim command from guest to LVM. In default setup LVM is trim-aware.
 
Use virtio disk and virtio-scsi for controller. The virtio-scsi controller will pass-through the trim command from guest to LVM. In default setup LVM is trim-aware.

Great, thanks. How do I use a virtio-scsi controller? I see I can set up a VIRTIO interface when adding a new disk, is there a driver I must enable on the guest OS?
 
Actually one more question. From the guest OS perspective I understand that for KVM I'll have to enable it per OS (for example our Windows Server 2008 R2 VM), do I have to do the same on containers or does that fall to the host OS to do?
 
I container effectively run on the host but in case of using NFS storage I think you are out of luck since AFAIK NFS is not trim-aware.
 
I container effectively run on the host but in case of using NFS storage I think you are out of luck since AFAIK NFS is not trim-aware.

That's fine, I won't be using NFS as it will be directly on the SSD.

So then to sum everything up (for the sake of anyone else searching this topic):

1. TRIM works on LVM.
2. On VMs disk type must be SCSI and SCSI type (under options) must be set to virtio. Then make sure TRIM is enabled on guest OS.
3. Containers do not require TRIM to be enabled per CT as long as it's enabled on the underlying disk on the host machine.
4. TRIM will not work on NFS targets.

Is this all correct?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!