Server 2012 RC hyper-v host with a Server 2012 RC hyper-v guest
The guest is running DFS replication and Deduplication.
Using DFS-R we replicated roughly 250 GB of data; the vhdx grew to 275 GB as expected.
We then applied deduplication and the volume shrunk by roughly 50% down to 125 GB.
Shut down the guest and ran a Compact operation on the vhdx expecting it to shrink - it remains at 275 GB.
This effectively negates any benefit to the deduplication - is there something special we need to do to actually reclaim this space and shrink the vhd?
Dedup only works on at rest files. A VM's files are not at rest. See http://www.aidanfinn.com/?p=11979 It is also not a constant process. AFAIK it "chunks" the files once per night, but you an force that to happen somehow. Not had a chance to get into it yet.
Hi Aidan, I'm not following... We are running dedup inside the guest, not on the host. Now that dedup has run inside the guest and the volume is reporting that it is only taking up 125 GB of space, shouldn't we able to shrink the vhdx file accordingly?
Hmm... not sure it has anything to do with deduplication. Took another vhdx that had 39 GB of data on it and deleted 9 GB so it is showing 30 GB used. When I try to shrink that one it finishes immediately and does not shrink at all. Perhaps vhd compacting is somehow broken in the RC?
Got some suggestions on the technet forum. Defragged and then ran a "full" optimization via powerhell and got down to 210 gigs. Defragged and compacted again and got down to 200. Still not the 125 it should be, but some progress at least.
Update - same issue on another separate installation, same configuration. After two passes of defrag/optmize-vhd was able to shrink a vhd from 350gb to 180gb (again not as small as the actual data set, but a big improvement). Looks like MS still has a bit of work to do to get the dedup benefits translated over to the virtual world!