Virtual Disk Types
The following disk types are defined in the virtual disk library:
VIXDISKLIB_DISK_MONOLITHIC_SPARSE – Growable virtual disk contained in a single virtual disk file. This is the default type for hosted disk, and the only setting in the Virtual Disk API Sample Code sample program.
VIXDISKLIB_DISK_MONOLITHIC_FLAT – Preallocated virtual disk contained in a single virtual disk file. This takes time to create and occupies a lot of space, but might perform better than sparse.
VIXDISKLIB_DISK_SPLIT_SPARSE – Growable virtual disk split into 2GB extents (s sequence). These files can to 2GB, then continue growing in a new extent. This type works on older file systems.
VIXDISKLIB_DISK_SPLIT_FLAT – Preallocated virtual disk split into 2GB extents (f sequence). These files start at 2GB, so they take a while to create, but available space can grow in 2GB increments.
VIXDISKLIB_DISK_VMFS_FLAT – Preallocated virtual disk compatible with ESX 3 and later. Also known as thick disk. This managed disk type is discussed in Managed Disk and Hosted Disk.
VIXDISKLIB_DISK_VMFS_SPARSE – Employs a copy-on-write (COW) mechanism to save storage space.
VIXDISKLIB_DISK_VMFS_THIN – Growable virtual disk that consumes only as much space as needed, compatible with ESX 3 or later, supported by VDDK 1.1 or later, and highly recommended.
VIXDISKLIB_DISK_STREAM_OPTIMIZED – Monolithic sparse format compressed for streaming. Stream optimized format does not support random reads or writes.
Persistence Disk Modes
In persistent disk mode, changes are immediately and permanently written to the virtual disk, so that they survive even through to the next power on.
In nonpersistent mode, changes to the virtual disk are discarded when the virtual machine powers off. The VMDK files revert to their original state.
The virtual disk library does not encapsulate this distinction, which is a virtual machine setting.
VMDK File Naming
VMDK Virtual Disk Files explains the different types of virtual disk. The first column corresponds to Virtual Disk Types but without the VIXDISKLIB_DISK prefix. The third column gives the possible names of VMDK files as implemented on Workstation and ESX/ESXi hosts.
For information about other virtual machine files, see section “Files that Make Up a Virtual Machine” in the VMware Workstation User’s Manual. On ESX/ESXi hosts, VMDK files are type VMFS_FLAT or VMFS_THIN.
In Select A Disk Type, accepting the defaults by not checking any box produces one VMDK file that can grow larger if more space is needed. The <vmname> represents the name of a virtual machine.
MONOLITHIC_FLAT
or VMFS_FLAT
or VMFS_THIN
If you select only the Allocate all disk space now check box, space is pre-allocated, so the virtual disk cannot grow. The first VMDK file is small and points to a much larger one, whose filename says flat without a sequence number.
If you select only the Split disk into 2GB files check box, virtual disk can grow when more space is needed. The first VMDK file is small and points to a sequence of other VMDK files, all of which have an s before a sequence number, meaning sparse. The number of VMDK files depends on the disk size requested. As data grows, more VMDK files are added in sequence.
If you select the Allocate all disk space now and Split disk into 2GB files check boxes, space is pre-allocated, so the virtual disk cannot grow. The first VMDK file is small and points to a sequence of other files, all of which have an f before the sequence number, meaning flat. The number of files depends on the requested size.
MONOLITHIC_SPARSE or SPLIT_SPARSE snapshot
A redo log (or child disk or delta link) is created when a snapshot is taken of a virtual machine, or with the virtual disk library. Snapshot file numbers are in sequence, without an s or f prefix. The numbered VMDK file stores changes made to the virtual disk <diskname> since the original parent disk, or previously numbered redo log (in other words the previous snapshot).
Space-efficient sparse (seSparse) format. In vSphere 5.1 and later, used by VMware View to optimize linked clone templates.
For lazy zeroed thick disk, all blocks are allocated, and data written to used blocks, however unused blocks are left as-is, so they may contain data from previous use. Many storage systems will zero-out unused blocks in the background. With eager zeroed thick disk, unused blocks are zeroed-out at allocation time.
Thin Provisioned Disk
With thin provisioned disk, the vSphere Client may report that provisioned size is greater than disk capacity.
Provisioned size for a thin disk is the maximum size the disk will occupy when fully allocated. Actual size is the current size of the thin disk. Overcommit means that if all thin disks were fully provisioned, there would not be enough space to accommodate all of the thin disks.
Internationalization and Localization
The path name to a virtual machine and its VMDK can be expressed with any character set supported by the host file system. As of vSphere 4 and Workstation 7, VMware supports Unicode UTF-8 path names, although for portability to various locales, ASCII-only path names are recommended.
Windows 2000 systems (and later) use UTF-16 for localized path names. For example, in locale FR (Français) the VDDK sample code might mount disk at C:\Windows\Temp\vmware-Système, where è is encoded as UTF-16 so the VixMntapi library cannot recognize it. In this case, a workaround is to set the tmpDirectory configuration key with an ASCII-only path before program start-up; see Initialize the Library.
For programs opening arbitrary path names, Unicode offers a GNU library with C functions iconv_open() to initialize codeset conversion, and iconv() to convert UTF-8 to UTF-16, or UTF-16 to UTF-8.
Virtual Disk Internal Format
The Virtual Disk Format 5.0 technical note provides possibly useful information about the VMDK format, and is available at this URL:
http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf
Grain Directories and Grain Tables
SPARSE type virtual disks use a hierarchical representation to organize sectors. See Virtual Disk Format 5.0 referenced in Virtual Disk Internal Format. In this context, grain means granular unit of data, larger than a sector. The hierarchy includes: