VMware Communities
munrobasher
Enthusiast
Enthusiast

Cleanup, defragment & compact

These three options appear to cross over each other a little so would appreciate some clarification:

  1. Defragment appears to require as much free disk space as the size of the disk being defragmented because it creates a very large tmp file. I assume the thinking here is to create a copy of the VMDK file assuming that the new file will be written pretty much consecutively on the host drive:
    1. Does this not depend upon how fragmented the host drive is?
    2. Does it also compact the disk at the same time?
    3. Should you clean before you defragment so the TMP file is as small as possible?
    4. Is not defragmenting the host drive achieving the same result?
  2. Compact works on the VMDK in situ, i.e. it doesn't need lots of free disk space:
    1. I'm guessing that it moves sectors around inside the VMDK so that all used sectors are at the start of the file so it can shrunk in size?
  3. Manage, Cleanup : does this do a cleanup, defragment or both??
Reply
0 Kudos
3 Replies
munrobasher
Enthusiast
Enthusiast

I suspect "Cleanup" does a "Compact" as it doesn't create a tmp file during the process.

Reply
0 Kudos
wenwang_myheave
Enthusiast
Enthusiast

The Clean up disks command is similar to the Compact command in the Workstation Pro virtual machine settings and the shrink command provided by VMware Tools. The Clean up disks command has these advantages:

  • You can use the Clean up disks command with virtual machines that have snapshots or are linked clones or parents of a linked clone.
  • The Clean up disks command reclaims more disk space than the Compact command.The Clean up disks command reclaims disk space from the current state of the virtual machine, from any powered-off snapshots, and from any powered-on snapshots where the guest operating system is Windows XP or later and you have installed a version of VMware Tools that is compatible with Workstation 8 or later.
  • Unlike the Defragment command and the shrink command provided by VMware Tools, the Clean up disks command does not require any extra disk space on the host. The Clean up disks command operates directly on the virtual disk (.vmdk) files.
Reply
0 Kudos
wenwang_myheave
Enthusiast
Enthusiast

Like physical disk drives, virtual hard disks can become fragmented. Defragmenting disks rearranges files, programs, and unused space on the virtual disk so that programs run faster and files open more quickly. Defragmenting does not reclaim unused space on a virtual disk.

There must be adequate free working space on the host system to defragment a virtual hard disk. If the disk is contained in a single file, for example, you need free space equal to the size of the disk file. Other virtual hard disk configurations require less free space. You cannot defragment a virtual hard disk while it is mapped or mounted.

Compacting a virtual hard disk can reclaim unused space in the virtual disk. Modern disks and operating systems are much more efficient at managing disk space than in the recent past. Therefore, do not expect the compacting procedure to return large amounts of disk space to the host drive.

Reply
0 Kudos