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 the best.
VIXDISKLIB_DISK_SPLIT_SPARSE – Growable virtual disk split into 2GB extents (s sequence). These files start small but can grow to 2GB, which is the maximum allowed on old file systems. This type is highly manageable because split VMDK can be defragmented and works on all 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 and consume disk, but available space can grow.
VIXDISKLIB_DISK_VMFS_FLAT – Preallocated virtual disk compatible with ESX 3 and later. This is a type of “managed disk” introduced in Managed Disk and Hosted Disk.
VIXDISKLIB_DISK_VMFS_THIN – Growable (sparse) virtual disk compatible with ESX 3 and later. As of VDDK 1.1, thin-provisioned is a supported type of managed disk that saves storage space.
VIXDISKLIB_DISK_STREAM_OPTIMIZED – Monolithic sparse format compressed for streaming. Stream optimized format does not support random reads or writes.
Sparse disks employ the copy-on-write (COW) mechanism, in which virtual disk contains no data in places, until copied there by a write. This optimization saves storage space.
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.
Note When you open a VMDK file with the virtual disk library, always open the one that points to the others, not the split or flat sectors. The file to open is most likely the one with the shortest name.
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.
Similarly on VMFS partitions, this is the virtual disk file that points to virtual disk data files, either thick or thin provisioned.
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 format, used by VMware View for redo logs and snapshots. Available in vSphere 5.1 and later.
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
A document detailing the VMware virtual disk format is available on request. To obtain the document, navigate to the Virtual Machine Disk Format page at this Web address:
http://www.vmware.com/technical-resources/interfaces/vmdk.html
Click the Request... specification link. Provide your name, organization, and email address. A link to the online PDF document should arrive shortly in your email inbox. The Virtual Disk Format 5.0 technical note provides useful information about the VMDK format.
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: