Understanding different kinds of virtual disks and their creation using vSphere SDK
0 comments Posted by vvirtualizeFollowing are the virtual disk types that are relevant to ESX/ESXi:
1. thin
2. pre-allocated (should be used instead of “thick” which we do not recommend any more)
3. eagerZeroedThick
4. rdm
5. rdmp
For the first 3 types of virtual disks, one should use the VirtualDiskFlatVer2BackingInfo as the backing for your VirtualDisk in the the VirtualMachineConfigSpec when creating/reconfiguring the VM.
* If the thinProvisioned property is set, it is a thin disk
* If thinProvisioned is false (or not set) AND eagerlyScrub is false (or not set), it is a preallocated disk
* If eagerlyScrub is true AND thinProvisioned is false, it is an eagerZeroedThick disk
For the last 2 types of virtual disks, one should use the
VirtualDiskRawDiskMappingVer1BackingInfo as part of the
VirtualMachineConfigSpec when creating/reconfiguring the VM.
* If the compatibilityMode property is set to virtualMode, the disk is of type rdm
* If it is set to physicalMode, the disk is of type rdmp
Labels: virtual disk, vmdk
What should be disk.key parameter when adding multiple virtual disks?
0 comments Posted by vvirtualizeWhen adding multiple virtual disks to a VM (either during createVM or reconfig operation), we assign the disk.key as a negative number. This ensures that hostd automatically assigns a unique positive key to the new virtual disk. However, when adding multiple disks, this negative number should also be unique. For e.g., while adding 2 virtual disks, both disks should not have same negative integer assigned, for e.g., "-100". It should be -100 and -101.
We have sometimes seen a behavior which leads to additional 0-byte VMDKs being created because of same negative number being assigned to all virtual disks being added. With unique negative number for each virtual disk, this issue got resolved.

Labels: disk.key, virtual disk, vmdk