SSD ata-trim for guest in virtio configuration not working

aleh

New Member
Jul 30, 2014
5
0
1
Dear all,

playing around a while to test ata-trim, pve 3.4, 3.10.0-8, on Samsung ssd 840+850 both evo.

Host on ext4, noop, noatime, barrier=0, without discard, running fstrim periodically by cron.

Windows guest Win7, 0.1.103 virtio, qcow2 with discard option, validation by trimcheck.exe and output of fstrim in host-shell.

** Working: Ide/Sata: trim launched by itself after some seconds (without manual fstrim in host shell).
** Not working: Virtio: trim not working, also during fstrim launch on host no difference in the result.

Tried various options in configuration: combinations of virtio and scsi hdd, and combinations of virtio and scsi controllers.
It looks like discard option in the hdd attach dialog is mandatory (in opposite to the host config), but I am lacking the working virtio config combination.

Has anybody found a working solution using virtio-drivers and ssd-trim (ata-trim) in windows guests?

Same behaviour on Win8.1 and Ubuntu14, Ide/Sata-hdd based trim on both working (with discard option in guest hdd dialog), but not in virtio/scsi combination.

Maybe any hints on this topic? Had found some discussions concerning virtio-block and virtio-scsi, but I am not sure if this is actual and related to this problem.

Thanks and best wishes

Alex

Edit: kernel version
 
Last edited:
Hi spirit,

many thanks for your support! Tried in this combination, but Win7 (64bit) still deny to trim. Trimcheck "not working", also no bytes to trim via host shell using fstrim.

Because it is working via IDE/SATA I think there is some mismatch in my virtio driver setup. Maybe do you remember your driver version for Windows or which sub-dir on the virtio-iso to use for the storage devices?

Already tried a fresh install of Win7 x64 specifying the iso during install, but had no luck with trim (hdd scsi, controller virtio, discard enabled). But using this procedure I am now able to trim on Ubuntu, thanks a lot!

Thanks and best wishes
 
Hi,
for windows,
I found some doc in this redhat bugzilla

https://bugzilla.redhat.com/show_bug.cgi?id=1159735

Code:
4) on the host:

$ du -h ~/win2012r2-test.qcow2 
2,0G	/home/pbonzini/win2012r2-test.qcow2

5) from "This PC" select "New Volume (E:)", Drive Tools (in the title bar), Optimize.  You should see a new window with.

Drive             Media type               Last run         Current status
OS_Install (C:)   Thin provisioned drive   Never run        OK
New Volume (E:)   Thin provisioned drive   Never run        OK

6) Click "Optimize" and wait a minute or so.  Current status will go through "Analyzing allocations...", "Enumerating slabs: xx%", "xx% slab-consolidated", "xx% trimmed", "OK (100% space efficiency)".

7) on the host:

$ du -h ~/win2012r2-test.qcow2 
595M	/home/pbonzini/win2012r2-test.qcow2
[B][COLOR=#000000][FONT=DejaVu Sans][URL="https://bugzilla.redhat.com/show_bug.cgi?id=1159735#c4"]Comment 4[/URL][/FONT][/COLOR]


[/B]
 
Hi spirit,

thanks for the hint, I had not really time to try the thin-client trim, but it's on my to-do list in the next weeks (because I like to run thin qcow2) :)

Thrown away the Win7, used instead a Win8.1, installed using the same virtio drivers release like the Win7, and finally: works. (labelled "Red Hat Virtio Scsi pass-through controller").
Don't know why Win7 won't trim with Scsi-Virtio in my setup, no problem with Ide/Sata and trim.

Btw, if you are using Win8.1 is the type of drive shown as SSD? (in the on-board optimize tool) Looking in the provision of AHCI in guests. (?)

OT: anybody tried ata-trim on Esxi6? Corresponding host unmap command, including option for block write, maybe not -the- real ata-trim.

Another time thanks and best wishes
 

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!