VixDiskLib_Create() locally creates a new virtual disk, after being connected to the host. In
createParams, you must specify the disk type, adapter, hardware version, and capacity as a number of sectors. This function supports hosted disk. For managed disk, first create a hosted type virtual disk, then use
VixDiskLib_Clone() to convert the virtual disk to managed disk.
Currently VixDiskLib_Create() enforces a 4GB limit for virtual disks on FAT32 and FAT file systems, a 16TB - 54KB (hex FFFFFFF0000) limit on NTFS file systems, and a 2^64 - 1 limit (more than an exabyte) on ReFS and exFAT file systems. VMDK files > 2TB are supported on vSphere 5.5 and later.
After the library connects to a workstation or server, VixDiskLib_Open() opens a virtual disk. With SAN or HotAdd transport, opening a remote disk for writing requires a pre-existing snapshot.
VixDiskLib_Read() reads a range of sectors from an open virtual disk. You specify the beginning sector and the number of sectors. Sector size could vary, but is defined in
<vixDiskLib.h> as 512 bytes because VMDK files have that sector size.
VixDiskLib_Write() writes one or more sectors to an open virtual disk. This function expects the fourth parameter
buf to be
VIXDISKLIB_SECTOR_SIZE bytes long.
VixDiskLib_Close() closes an open virtual disk.
VixDiskLib_Close() returns
VIX_OK if successful, otherwise a suitable error code. To obtain a list of possible return codes, see
Finding Error Code Documentation.
VixDiskLib_GetInfo() gets data about an open virtual disk, allocating a filled-in
VixDiskLibDiskInfo structure. Some of this information overlaps with metadata (see
Metadata Handling).
This function deallocates memory allocated by VixDiskLib_GetInfo(). Call it to avoid a memory leak.