This procedure calls VixDiskLib_Create() to allocate virtual disk. Adapter type is SCSI unless specified as IDE on the command line. Size is 100MB, unless set by -cap on the command line. Because the sector size is 512 bytes, the code multiplies appGlobals.mbsize by 2048 instead of 1024. Type is always monolithic sparse and Workstation 5. In a production application, progressFunc and callback data can be defined rather than NULL. Type these commands to create a sample VMDK file (the first line is for Linux only):
export LD_LIBRARY_PATH=/usr/lib/vmware-vix-disklib/lib64
vix-disklib-sample -create sample.vmdk
As a VMDK file, monolithic sparse (growable in a single file) virtual disk is initially 65536 bytes (2 ^ 16) in size, including overhead. The first time you write to this type of virtual disk, as with DoFill() below, the VMDK expands to 131075 bytes (2 ^ 17), where it remains until more space is needed. You can verify file contents with the -dump option.