Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Although TRIM support was introduced to make SSD work better, it should also help virtual machines optimizing virtual disks (for example to know which parts of virtual disks needs no storage on physical partitions). Does any VM machine use TRIM this way?

share|improve this question
add comment

3 Answers

Virtualbox and vSphere supports TRIM for the guest. Windows 8 also supports TRIM for the new VHDX image format

VMware Workstation 10 supports SSD passthrough too.

share|improve this answer
    
It's quite possible that this is what I was looking for. Thanks. –  liori Sep 18 '13 at 10:36
add comment

TRIM support requires intimate knowledge of the underlying hardware. Since Virtual machines (VM Guests) by definition run on virtual hardware, they are not aware of the details of the hard drive or SSD on which they reside.

So, if the VM Host operating system understands TRIM, that should be sufficient for all VM Guests running on top of it.

Some VM Hosts can "pass through" a physical drive and mount it directly to the operating system on a VM Guest. Depending on the exact implementation, it is theoretically possible that the Guest could then support the TRIM feature of an SSD. As with most things, your mileage may vary, and if it's critical for your environment you should test it thoroughly before you commit.

share|improve this answer
    
The only thing I would add is if the vm hard drive file is dynamic, you could shrink it and the host would then, if appropriate, tell the SSD to trim the newly freed sectors. This may speed vm hard drive file writes because when the file grows your not modifying existing host sectors, new/trimmed sectors could be used for the guest's write. Normally I fix size on my vm hard drive files, but that is to prevent fragmentation on HDs. With SSDs I would probably go dynamic and periodic shrink. –  Scott McClenning Oct 1 '10 at 5:32
add comment

TRIM was invented because writes to an SSD must be done in 512K blocks and detmining how much of a block is actually used by a file or files is impossible for the SSD drive itself and must be communicated by the OS and the filesystem.

See

http://en.wikipedia.org/wiki/TRIM

EDIT:

The wiki link says it better than I could:

The TRIM command does not work with disks which are stored in disk image files. This is caused by the fact that computer files can only be deleted completely or truncated at the end. This problem affects applications like virtual disk services, virtual machines, etc.

share|improve this answer
3  
VM could keep information about which blocks were trimmed to be used when user request to repack and shrink virtual disks. VMWare currently has a similar operation, but it works by overwriting all free space inside VM firstly. –  liori Sep 29 '10 at 9:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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