Windows 7 virtual desktop on differencing disk grows and grows!
If you create Windows 7 virtual desktops on VHDs with using differencing disks (on Hyper-V), based on a fresh install of Windows 7 and no optimizations then over 24 hours you'll see all differencing disks grow to the size of the used disk space in the parent VHD! The reason is simple - Windows 7 continually runs a background defragmentation task on the disk, and so it rearranges what it thinks is all it's used disk space block-by-block.
In the case of a VM using a differencing disk (a child disk linked to a parent) then it sees the combination of parent and child as its entire disk and it will defrag all the used space!
There's really no need for defrag with virtual disks, especially for virtual desktops which will be continually refreshed and recreated, so you can disable this task and save yourself a ton of storage space! After all, the point of using differencing disks is to save storage space, right?
Here's the magic command line to disable that defrag task. Run this on your master image:
There is also the newly released (beta) of Microsoft's VDI Optimizer... You pick the options, it creates a VB Script that you can manually run inside the virtual machine or push out using something like GPO or vWorkspace tasks..
aaron fox
2 Posts
870
1
Posted September 21st, 2010 13:00
Quite useful for Win 7 users that have SSDs as well. Thanks for sharing.