Tuesday, June 23, 2009

Defragmenting the virtual disk

Virtualization provides extremely fast I/O to the virtual machine. Compound the linear Access speed of a single file virtual disk on top of a RAID enabled Solid state drive SSD and your OS will seem like it is running entirely from RAM.
Nonetheless, the underlying virtualized disk begins to fragment like any real-world OS as your virtual disk usage matures. You may begin to see degradation is disk performance especially with heavy use of multiple virtual systems.
Fragmentation at the virtual disk level can be costly in terms of I/O and lost disk space. This can be avoided by defragmenting your disk at both levels. Here is how it woks:

Install on both the Guest OS and all virtual machines (guests) a defragmentation program. Each defragmentation engine optimizes its respective Windows OS and performs defragmentation of files and consolidation of free space. This minimizes unnecessary I/O passed from the OS to the disk subsystem and aligns data on the drives for optimal access.

Some Links to Defragmentation tools and software

Diskeeper
Free defragmenter

Academic Links -

Wikipedia

  • FAT: MS-DOS 6.x and Windows 9x-systems come with a defragmentation utility called Defrag. The DOS version is a limited version of Norton SpeedDisk.[8] The version that came with Windows 9x was licensed from Symantec Corporation, and the version that came with Windows 2000 and above (with the exceptions of Vista, Server 2008, and 7) is licensed from Diskeeper Corporation.
  • NTFS: Windows 2000 and newer include a defragmentation tool based on Diskeeper. Windows NT 4.0 includes an application programming interface that third-party tools can use to perform defragmentation tasks, but no command-line or graphical tools are included that make use of it. Windows NT 3.51 and below do not include any defragmentation capabilities. A number of free and commercial third-party defragmentation products are available for Microsoft Windows.
  • ext2 (Linux) uses an offline defragmenter called e2defrag, which does not work with its successor ext3. Instead, a filesystem-independent defragmenter like Shake[9] may be used.
  • ext4 (Linux) comes with an online defragmenter.
  • vxfs has fsadm utility meant to perform also defrag operations.
  • JFS has a defragfs[10] utility on IBM operating systems.
  • HFS Plus (Mac OS X) In 1998 it introduced a number of optimizations to the allocation algorithms in an attempt to defragment files while they are being accessed without a separate defragmenter. If the filesystem does become fragmented, the only way to do it is to purchase a defragmenting utility, such as Coriolis System's iDefrag or to wipe the hard drive completely and install the system from scratch.
  • WAFL in NetApp's ONTAP 7.2 operating system has a command called reallocate that is designed to defragment large files.
  • XFS Provides an online defragmentation utility called xfs_fsr.
  • SFS Processes the defragmentation feature in almost completely stateless way (apart from the location it is working on), so defragmentation can be stopped and started instantly.