Virtual disk image
A virtual disk image is a file on a physical disk, which has a well-defined, published or proprietary, format and is interpreted by a Virtual Machine Monitor as a hard disk. IT administrators and software developers administer them through offline operations using built-in or third-party tools. 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 predominant across all Virtual Machine Monitor implementations, namely,
- Preallocate the entire storage for the virtual disk upon creation, or,
- Dynamically grow the storage on demand
Preallocated 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 [1] 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 [1] 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.
Operation | Create Virtual Disk and Allocate Storage | Raw Disk Mappings | ||||
---|---|---|---|---|---|---|
Policy | Pre-allocate | Allocate On Demand | ||||
File / Disk Type | Split File Flat | Monolithic File Flat | Split File Sparse | Monolithic File Sparse | Virtual Mode | Physical Mode (Passthru) |
Commercial Products | ||||||
VMware ESX Server [1][2] | Import | Native | Native | Native | Native | Native (SCSI) |
VMware Workstation [3] | Native | Native | Native | Native | Native (IDE) | |
VMware Fusion [4] | Native | Native | Native | Native | ||
VMware Server [5] | Native | Native | Native | Native | ||
Xen [6] | Native | Native | Native | Native | Native | |
Microsoft Windows Server 2008 R2 [7] | Native | Native | Native | |||
Microsoft Virtual PC 2007 [8] | Native | Native | ||||
Microsoft Virtual Server 2005 | Native | Native | ||||
VirtualBox [9] | Import | Native | Import | Native | Native | |
Parallels Desktop [10] | Native | Native | Native | Native | ||
Parallels Workstation [11] | Native | Native | Native | Native | ||
Parallels Server Bare Metal [12] | Native | Native | Native | Native |
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.
Commercial Products | VMDK | VHD | Virtual Disk Image | Oracle VM Image | Parallels hdd | qcow qcow2 |
---|---|---|---|---|---|---|
VMware ESX Server | Native | Native | ||||
VMware Workstation | Native | Native | ||||
VMware Fusion | Native | Native | ||||
VMware Server | Native | Native | ||||
VMware Player | Native | Native | ||||
Xen | Native | Native | ||||
Microsoft Windows Server 2008 R2 | Native | |||||
Microsoft Virtual PC 2007 | Native | |||||
Microsoft Virtual Server 2005 R2 | Native | |||||
Oracle VM VirtualBox | Native | Native | Native | Native (v.2)[13] | ||
Oracle VM | Import | Import | Native | |||
Parallels Desktop | Native | |||||
Parallels Workstation | Native | |||||
Parallels Server Bare Metal | Native | |||||
QEMU | Native | Native | Native | Native |
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[1] for VMware ESX, vmware-vdiskmanager [14] for VMware Workstation, Fusion and Server; vboxmanage [9] for VirtualBox, or,
- Discrete tools supporting one or more operations on virtual disk files of a given format, e.g., VHD Tool[15], or across one or more product lines, e.g., SCVMM [16], 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.
Virtual Disk Image Operation | Create | Convert (Import) | Export | Clone | Extend / Expand / Enlarge | Shrink | Defragment | Live Migrate |
---|---|---|---|---|---|---|---|---|
Disk Type | All | All | All | All | Pre-Allocated | Dynamic Growth | Dynamic Growth | All |
Commercial Products | ||||||||
VMware ESX Server [1][2] | vmkfstools [1] | vmkfstools [1] | vmkfstools [1] | vmotion [17] | ||||
VMware Workstation [3] | vdiskmanager [14] | vdiskmanager [14] | vdiskmanager [14] | vdiskmanager [14] fatVM [18] |
vdiskmanager [14] | vdiskmanager [14] contig [19] |
||
VMware Fusion [4] | ||||||||
VMware Server [5] | ||||||||
Xen [6] | ||||||||
Microsoft Windows Server 2008 R2 [7] | Hyper-V Manager [20] | Hyper-V Manager [20] SCVMM [16] |
Sysprep [21] | Hyper-V Manager [20] | Hyper-V Manager [20] SCVMM [16] |
|||
Microsoft Virtual PC 2007 [8] | vhdtool [15] | SCVMM [16] vmdk2vhd [22] StarWind [23] WinImage [24] SmartVDK [25] |
vhdtool [15] VHD Utility [26] VHD Resizer [27] EASEUS [28] eXPander</ref> |
SCVMM [16] VHD Resizer [27] |
contig [19] | |||
Microsoft Virtual Server 2005 | ||||||||
VirtualBox [9] | vboxmanage [9] | vboxmanage [9] | vboxmanage [9] | vboxmanage [9] | vboxmanage [9] | contig [19] | vboxmanage [9] | |
Parallels Desktop [10] | File Menu [10] | Transporter [29] | Transporter [29] | Clone VM Assistant [10] | Image Tool [30] | Compressor [31] | ||
Parallels Workstation [11] | File Menu [11] | Clone VM Wizard [11] | Image Tool [30] | |||||
Parallels Server Bare Metal [12] | New VM Assistant [12] | Clone VM Assistant [12] | ||||||
QEMU / KVM | qemu-img create [32] | virt-v2v [33] | virt-clone | virt-resize [34] | virt-resize | virsh migrate [35] |
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.
References
- ^ a b c d e f g h "VMWare ESX Configuration Guide" (PDF). VMware, Inc. 18 May 2010. Retrieved 10 December 2010.
- ^ a b "VMware vSphere Basic System Administration" (PDF). VMware, Inc. 29 September 2010. Retrieved 10 December 2010.
- ^ a b "VMware Workstation User's Manual" (PDF). VMware. 11 November 2009. Retrieved 10 December 2010.
- ^ a b "Getting Started with VMware Fusion" (PDF). VMware, Inc. 26 August 2009. Retrieved 10 December 2010.
- ^ a b "VMware Server User's Guide" (PDF). VMware, Inc. 15 September 2008. Retrieved 10 December 2010.
- ^ a b "Xen Users' Manual". Tx.downloads.xensource.com. 2005-12-05. Retrieved 2010-05-16.
- ^ a b Barreto, Jose (14 February 2008). "Storage options for Windows Server 2008 Hyper-V". Jose Barreto's Blog (TechNet Blogs). Microsoft Corporation. Retrieved 10 December 2010.
- ^ a b "Virtual hard Disk Image Format Specification". Microsoft TechNet. Microsoft Corporation. Retrieved 2010-05-16.
- ^ a b c d e f g h i "VirtualBox User Manual" (PDF). Retrieved 2010-05-16.[dead link ]
- ^ a b c d "Parallels Desktop User Guide" (PDF). Parallels Holdings, Ltd. 19 November 2009. Retrieved 10 December 2010.
- ^ a b c d "Parallels Workstation 4.0 Extreme User's Guide" (PDF). Parallels Holdings, Ltd. 25 November 2009. Retrieved 10 December 2010.
- ^ a b c d "Parallels Server Bare Metal User's Guide" (PDF). Parallels Holdings, Ltd. 20 April 2010. Retrieved 10 December 2010.
- ^ Disk image files (VDI, VMDK, VHD, HDD) in "Chapter 5. Virtual storage". Oracle VM VirtualBox User Manual. Oracle Corporation. 1 December 2010. Retrieved 10 December 2010.
- ^ a b c d e f g "Virtual Disk Manager User's Guide" (PDF). VMware, Inc. 1 October 2008. Retrieved 10 December 2010.
- ^ a b c "VHD Tool". MSDN. Microsoft Corporation. Retrieved 10 December 2010.
- ^ a b c d e "System Center Virtual Machine Manager". Microsoft TechNet. Microsoft Corporation. Retrieved 10 December 2010.
- ^ "VMware Storage VMotion: Non-Disruptive Live Migration for Virtual Machine Storage Disk Files" (PDF). VMware, Inc. 16 October 2009. Retrieved 10 December 2010.
- ^ "fatVM". Gudgud.com.
- ^ a b c "Windows Sysinternals: Contig" utility. Microsoft.
- ^ a b c d "Hyper-V Manager". Microsoft.
- ^ "How to use Sysprep: An Introduction". Microsoft.
- ^ "VMDK(VMware) to VHD Converter". VMToolKit.com.
- ^ "V2V Converter". Starwind.com.
- ^ "WinImage".
- ^ "SmartDeploy". SmartDeploy.com.
- ^ "VHD Utility".[dubious – discuss]
- ^ a b "VHD Resizer". VMToolKit.com.
- ^ "EASEUS Partition Master". partition-tool.com.
- ^ a b "Parallels Transporter User Guide" (PDF). Parallels Software International, Inc. 4 December 2007. Retrieved 10 December 2010.
- ^ a b "Parallels Image Tool User's Guide" (PDF). Parallels Holdings, Ltd. 20 October 2009. Retrieved 10 December 2010.
- ^ "Parallels Compressor User's Guide" (PDF). Parallels Holdings, Ltd. 10 December 2008. Retrieved 10 December 2010.
- ^ "Wikibooks QEMU Images".[dubious – discuss]
- ^ "Fedora Feature: Xen to KVM migration". Fedora Project.
- ^ "Virt-resize manual". LibGuestFS.org.
- ^ "Red Hat Enterprise Linux 6 Virtualization Guide: KVM live migration". Redhat.com.