If you can afford the down time, you can stop the VM, add the VHD to another
VM and defrag it from there. This way you don't have 'unmovable' files to
worry about.
Of course you may still need to defrag the VHD from the host and that's
explained below.
Joschka
"Jesper Arnecke" <JesperArnecke@discussions.microsoft.com> wrote in message
news:87D9F0F9-BCFE-4ACF-8FB4-0D0406FD60AC@microsoft.com...
> Heres a few golden ones on Virtual server setup(2005 R2):
>
> One of the biggest problems in the disk setup currently is dynamic disks
> vs.
> fixed disks.
> Should you choose dynamic disks to allow are greater deal of fleksibility
> on
> the host disk space?
> or should you go for fixed disks?
>
> So far there is no correct answer to this, however I have a few good
> pinpointers:
> 1: Fragmentation is the key word in this discussion. The absolute drawback
> about using dynamic disks is the fragmentation. As you cannot change the
> default chunk size of the dynamic disks, they will only grow with a few
> megs
> when required. This is not a problem when your working with large files,
> that
> cause growth in a continuesly flow. However with log files or similar,
> that
> grows a little, in an unsteady flow, this will cause fragmentation. - we
> had
> a 9mb file fragmented into as much as 1980 pieces. This is really only a
> problem if your using the log files. Adding data to them is not a problem,
> but as soon as you want to display it, the disk needs to fetch all 1980
> pieces. = Not good. an example is the Event Viewer logs, 3 logs that a
> often
> used. If you have other application logs, accessed by monitoring, you will
> have problems again.
> So how workaround this?
> Basically it all comes down to thinking about using preallocated space. -
> This is also the reason why it's not a problem for SQL, as it preallocates
> for both data files and log files.
> Basically what you want to do is copy in a file of say, 10GB to your
> dynamic
> disk drive. This means you will "preallocate" 10GB of the 100GB on your
> dynamic drive. If you delete the file, you will still have the 10GB
> reserved
> on your dynamic disk, as dynamic disk will not compress itself unless you
> run
> a command to do this.
> There might be some application that can do this for you, but until now we
> are operating this on a manually basis.
> Another consideration is that some systems grow very slowly, while others
> have a tendency to a more rapid growth. - Analyse your system and stay
> ahead
> of things 
>
> 2: Deframentation of running systems
> If you use the windows build in tool for defragmentation, you will quickly
> be able to analyze and view a report of fragemented files. What you will
> notice is that even tho the actual guest system could be very little
> fragmented, but the files on the host system are very messed up. - So make
> sure you analyze both your guest and host.
> Defragmentation of the guest should be straight forward, using your
> preferred tool.
> Defragmentation of the host could have a few approaches:
> a: If you can afford downtime, the easiest solution is to shut it down,
> copy
> the virtual files from one drive to another on the host. Delete the
> original,
> and copy it back. Make sure that you have "unmounted" your virtual guest
> files from the administrative interface before copying. DO NOT copy a
> running
> Virtual Server guest, this could have a sever impact on your guest system!
> b: We are currently testing running a defragmentation of our host server
> with all the guests running. We expect it to be restarting a lot of times
> due
> to changes in the files, but we do expect it to be working after alot of
> restarts. For each file defragmented, we gain performance.
>
> Our setup is:
> We are currently running 8 stand alone Hosts(VS 2005 R2) with about 10-20
> virtual guests on each of them. All Win2k3.
>
> Bare in mind that the above observations are based on our own testing, on
> our own systems. Your system could be very different from ours, however
> the
> above should give you an idea on what to look for! - Enjoy