User:Barnet.Herts/Sandbox

=Virtual Machine Disk Images=

A virtual disk image is a file on a physical disk, which has a well-defned, published or proprietary, format and is interpreted by a Virtual Machine Monitor as a hard disk. In terms of naming, a virtual disk image for a certain Virtual Machine monitor has a specific file type extension, e.g., .vmdk for VMware VMDK, .vhd for Xen and Microsoft Hyper-V, .vdi for Oracle VM VirtualBox, etc.

Storage Allocation
There are two schemes pre-dominant across all Virtual Machine Monitor implementations, namely,
 * 1) Pre-allocate the entire storage for the virtual disk upon creation, or,
 * 2) Dynamically grow the storage on demand

Pre-Allocated Storage
The virtual disk is implemented as either split over a collection of flat files, typically each one is 2GB in size, collectively called a split flat file, or as a single, large monolithic flat file. The pre-allocated storage scheme is also referred to as a thick provisioning scheme.

Dynamic Storage Growth
The virtual disk can again be implemented using split or monolithic files, except that storage is allocated on demand. Several Virtual Machine Monitor implementations initialize the storage with zeros before providing it to the virtual machine that is in operation. The dynamic growth storage scheme is also referred to as a thin provisioning scheme.

Raw Disk Mapping
There are two modes in which a raw disk can be mapped for use by a virtual machine

Virtual mode
The mapped disk is presented as if it is a logical volume, or a virtual disk file, to the guest operating system and its real hardware characteristics are hidden. In this mode, file locking provides data protection through isolation for concurrent updates; the copy on write operation enables snapshots. Virtual mode also offers portability across storage hardware because it presents the consistent behavior as a virtual disk file.

Physical mode
In this mode, also called the pass through mode, the Virtual Machine Monitor bypasses the I/O virtualization layer and passes all I/O commands directly to the device. All physical characteristics of the underlying hardware are exposed to the guest operating system. There is no file locking to provide data protection.

Survey of Storage Allocation Policies and Raw Disk Mapping Support
This section intends to survey the storage allocation policies supported by several commercial Virtual Machine Monitors for creating virtual disks, and the support for raw device mappings. "Native" indicates that the capability is natively built-in to the product, "Import" indicates that a format conversion is necessary before the Virtual Machine Monitor can employ it.

Virtual Disk Formats
The following table provides a compatibility matrix that shows which particular virtual disk format is supported by a Virtual Machine Monitor. The term Native represents that the Virtual Machine Monitor inherently supports a particular virtual disk format, whereas, the term Import indicates that a conversion tool should be used to convert that format to another natively supported format.

Note that QEMU is strictly not a Virtual Machine Monitor. However, given that it is an integral component of key open source implementations, e.g., Xen, KVM, it is referenced here for completeness.

Offline Virtual Image Operations and Tools
This section surveys the tools offered by Virtual Machine Monitor and third-party vendors for some of the common operations performed on virtual disk images. The tools are offered either as,
 * A packaged suite for a given product line, e.g., vmkfstools for VMware ESX, vmware-viskmanager for VMware Workstation, Fusion and Server; vboxmanage for VirtualBox, or,
 * Discrete tools supporting one or more operations on virtual disk files of a given format, e.g., VHD Tool, or across one or more product lines, e.g., SCVMM , or,
 * Built-in menu items in the user interface of the product, e.g, create (new) virtual disk, in VMware Workstation, Fusion, and Server; VirtualBox; Parallels Dekstop and Workstation.

Each tool requires that the virtual disk image should be offline, i.e., no virtual machine that uses this virtual disk image should be executing when the operation is performed.

Note that the extension / expansion / enlargement is meaningful only for those virtual disk images that have pre-allocated storage. The shrink and defragment operations are supported only for virtual disk images that grow dynamically by allocating storage on demand. The latter operations are performed on the disk blocks belonging to the virtual disk image; a subsequent OS-level defragmentation is necessary to return blocks freed by them to the unallocated list.

The table below lists the virtual disk image operations and the tools available for performing them per commercial product.

There is a cluster of third party tools available for Microsoft Virtual PC and Virtual Server product lines for converting non-Microsoft virtual disk image formats to the VHD format, and for resizing (expanding or shrinking) virtual disk images in the VHD format.