In operation of a virtual Vmware or Hyper-V guest typically advice is given to defrag the host and virtual disk images so to result in improved performance.
Something like a cmd: vmware-vdiskmanager -d <file.vmdk> works great.
Yet I can't find any qualitive evidence that suggest defraging inside the guest VM improves performance. Does anyone have advice or evidence that doesn't come from a commercial defragger's whitepaper that suggests inside guest defragging helps?
It depends on the performance of your storage and the performance of your application. The challenge with current virtualization hosts is that each guest can only get 1 host bus adapter (HBA) of throughput to any given LUN. (The only exception to this is the latest VMware vSphere v4.0 - the very top level of licensing gets you the chance to run EMC's multipathing software.) So, if your throughput bottleneck is a single HBA even when no other guests are using the storage, fragmentation isn't usually going to be the weakest link in the virtual chain.
Plus, toss in the fact that several virtual guests usually share the same SAN lun anyway. If three servers are accessing their drives simultaneously, and they all share the same physical array, then all access is essentially random.
The only time I'd look at defragmenting virtual disks is if each guest had its own dedicated SAN array, and if HBA throughput wasn't a bottleneck.
My understanding is that the vdisk file is a file that acts like a physical disk. So I think the question is, does vdiskmanager actually understand the filesystem that lives on this disk. I think that that it does not, and that is why defragmenting within the OS should help.
Since you mention vmware and hyper-v guests I'll presume you're not running ESX versions of vmware, and are using more of a hosted model. Defragging the host OS is a good idea.
Defragging inside the guest though can be bad. I only have experience with vmware's products, not hyper-v, but if you have a guest with snapshots, defragging can cause you to use a large amount of disk space.
A snapshot is a delta of the changes made from the parent disk file. When you update a block in the guest, the size of the delta increases. If defragmenting touches every block, your snapshot would increase in size to consume the same amount of disk space as your original virtual hard drive. Just something to be aware of.
Brent's answer is certainly sensible. I came across several links while researching this topic this morning that recommend you should defrag the VM like you would a physical server.
http://itknowledgeexchange.techtarget.com/virtualization-pro/defragmenting-virtual-machine-disk-files/
http://www.vmware.com/support/gsx3/doc/disks_defrag_shrink_gsx.html
http://www.dciginc.com/2008/10/the-physical-challenges-of-disk-defragmentati.html
If we assume that there are multiple VMs accessing the LUN simultaneously then defragmentation would have limited value as Brent suggests. But simultaneous access of the LUN would not always be the case, so would internal defragmentation of the VM disk still provide some value?