Virtual disk image: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Offline Virtual Image Operations and Tools: Add notes about qemu & KVM tools.
→‎Offline Virtual Image Operations and Tools: Fix up refs (no preview of references in MediaWiki?)
Line 531: Line 531:
|-
|-
| QEMU / [[Kernel-based Virtual Machine|KVM]]
| QEMU / [[Kernel-based Virtual Machine|KVM]]
| qemu-img create <ref>https://secure.wikimedia.org/wikibooks/en/wiki/QEMU/Images</ref>
| qemu-img create <ref>{{Cite web
|url = https://secure.wikimedia.org/wikibooks/en/wiki/QEMU/Images
|title = Wikibooks QEMU Images
| virt-v2v <ref>https://fedoraproject.org/wiki/Features/Xen_to_KVM_migration</ref>
}}</ref>
| virt-v2v <ref>{{Cite web
|url = https://fedoraproject.org/wiki/Features/Xen_to_KVM_migration
|title = Fedora Feature: Xen to KVM migration
}}</ref>
|
|
| virt-clone
| virt-clone
| virt-resize <ref>http://libguestfs.org/virt-resize.1.html</ref>
| virt-resize <ref>{{Cite web
|url = http://libguestfs.org/virt-resize.1.html
|title = virt-resize manual
}}</ref>
| virt-resize
| virt-resize
|
|
| virsh migrate <ref>http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-KVM_live_migration-Live_KVM_migration_with_virsh.html</ref>
| virsh migrate <ref>{{Cite web
|url = http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-KVM_live_migration-Live_KVM_migration_with_virsh.html
|title = Red Hat Enterprise Linux 6 Virtualization Guide: KVM live migration
}}</ref>
|}
|}



Revision as of 20:24, 18 December 2010

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 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 [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-viskmanager [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 [29]
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 [30] Transporter [30] Clone VM Assistant [10] Image Tool [31] Compressor [32]
Parallels Workstation [11] File Menu [11] Clone VM Wizard [11] Image Tool [31]
Parallels Server Bare Metal [12] New VM Assistant [12] Clone VM Assistant [12]
QEMU / KVM qemu-img create [33] virt-v2v [34] virt-clone virt-resize [35] virt-resize virsh migrate [36]

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

  1. ^ a b c d e f g h "VMWare ESX Configuration Guide" (PDF). VMware, Inc. 18 May 2010. Retrieved 10 December 2010.
  2. ^ a b "VMware vSphere Basic System Administration" (PDF). VMware, Inc. 29 September 2010. Retrieved 10 December 2010.
  3. ^ a b "VMware Workstation User's Manual" (PDF). VMware. 11 November 2009. Retrieved 10 December 2010.
  4. ^ a b "Getting Started with VMware Fusion" (PDF). VMware, Inc. 26 August 2009. Retrieved 10 December 2010.
  5. ^ a b "VMware Server User's Guide" (PDF). VMware, Inc. 15 September 2008. Retrieved 10 December 2010.
  6. ^ a b "Xen Users' Manual". Tx.downloads.xensource.com. 2005-12-05. Retrieved 2010-05-16.
  7. ^ 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.
  8. ^ a b "Virtual hard Disk Image Format Specification". Microsoft TechNet. Microsoft Corporation. Retrieved 2010-05-16.
  9. ^ a b c d e f g h i "VirtualBox User Manual" (PDF). Retrieved 2010-05-16.[dead link]
  10. ^ a b c d "Parallels Desktop® User Guide" (PDF). Parallels Holdings, Ltd. 19 November 2009. Retrieved 10 December 2010.
  11. ^ a b c d "Parallels® Workstation 4.0 Extreme User's Guide" (PDF). Parallels Holdings, Ltd. 25 November 2009. Retrieved 10 December 2010.
  12. ^ a b c d "Parallels Server Bare Metal User's Guide" (PDF). Parallels Holdings, Ltd. 20 April 2010. Retrieved 10 December 2010.
  13. ^ 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.
  14. ^ a b c d e f g "Virtual Disk Manager User's Guide" (PDF). VMware, Inc. 1 October 2008. Retrieved 10 December 2010.
  15. ^ a b c "VHD Tool". MSDN. Microsoft Corporation. Retrieved 10 December 2010.
  16. ^ a b c d e "System Center Virtual Machine Manager". Microsoft TechNet. Microsoft Corporation. Retrieved 10 December 2010.
  17. ^ "VMware Storage VMotion: Non-Disruptive Live Migration for Virtual Machine Storage Disk Files" (PDF). VMware, Inc. 16 October 2009. Retrieved 10 December 2010.
  18. ^ [1], fatVM
  19. ^ a b c [2], Windows Sysinternals Contig
  20. ^ a b c d [3], Hyper-V Manager.
  21. ^ [4], How to use Sysprep: An Introduction.
  22. ^ [5], VMDK(VMware) to VHD Converter
  23. ^ [6], StarWind V2V Converter
  24. ^ [7], WinImage
  25. ^ [8], SmartDeploy
  26. ^ [9], VHD Utility
  27. ^ a b [10], VHD Resizer
  28. ^ [11], EASEUS Partition Master
  29. ^ [12], eXPander
  30. ^ a b "Parallels Transporter User Guide" (PDF). Parallels Software International, Inc. 4 December 2007. Retrieved 10 December 2010.
  31. ^ a b "Parallels Image Tool User's Guide" (PDF). Parallels Holdings, Ltd. 20 October 2009. Retrieved 10 December 2010.
  32. ^ "Parallels Compressor User's Guide" (PDF). Parallels Holdings, Ltd. 10 December 2008. Retrieved 10 December 2010.
  33. ^ "Wikibooks QEMU Images".
  34. ^ "Fedora Feature: Xen to KVM migration".
  35. ^ "virt-resize manual".
  36. ^ "Red Hat Enterprise Linux 6 Virtualization Guide: KVM live migration".