Data Structures in Virtual Disk API
Here are important data structure objects with brief descriptions:
VixError – Error code of type uint64.
VixDiskLibConnectParams – Public types designate the virtual machine credentials vmxSpec (possibly through vCenter Server), the name of its host, and the credential type for authentication. For details, see VMX Specification. The credType can be VIXDISKLIB_CRED_UID (user name / password, most common), VIXDISKLIB_CRED_SESSIONID (the HTTP session ID), VIXDISKLIB_CRED_TICKETID (vSphere ticket ID), or VIXDISKLIB_CRED_SSPI (Windows only, current thread credentials).
typedef char * vmxSpec
typedef char * serverName
typedef VixDiskLibCredType credType
VixDiskLibConnectParams::VixDiskLibCreds – Credentials for either user ID or session ID.
VixDiskLibConnectParams::VixDiskLibCreds::VixDiskLibUidPasswdCreds – String data fields represent user name and password for authentication.
VixDiskLibConnectParams::VixDiskLibCreds::VixDiskLibSessionIdCreds – String data fields represent the session cookie, user name, and encrypted session key.
VixDiskLibConnectParams::VixDiskLibCredsb::VixDiskLibSSPICreds – String data fields represent security support provider interface (SSPI) authentication. User name and password are null.
VixDiskLibCreateParams – Types represent the virtual disk (see Virtual Disk Types), the disk adapter (see Adapter Types), VMware version, and capacity of the disk sector.
typedef VixDiskLibDiskType diskType
typedef VixDiskLibAdapterType adapterType
typedef uint hwVersion
typedef VixDiskLibSectorType capacity
VixDiskLibDiskInfo – Types represent the geometry in the BIOS and physical disk, the capacity of the disk sector, the disk adapter (see Adapter Types), the number of child-disk links (redo logs), and a string to help locate the parent disk (state before redo logs).
VixDiskLibGeometry biosGeo
VixDiskLibGeometry physGeo
VixDiskLibSectorType capacity
VixDiskLibAdapterType adapterType
int numLinks
char * parentFileNameHint
VixDiskLibGeometry – Types specify virtual disk geometry, not necessarily the same as physical disk.
typedef uint32 cylinders
typedef uint32 heads
typedef uint32 sectors
Credentials and Privileges for VMDK Access
Local operations are supported by local VMDK. Access to ESXi hosts is authenticated by login credentials, so with proper credentials VixDiskLib can reach any VMDK on an ESXi host. VMware vSphere has its own set of privileges, so with the proper privileges (see below) and login credentials, VixDiskLib can reach any VMDK on an ESXi host managed by vCenter Server. VixDiskLib supports the following:
With vCenter Server, the Role of the backup appliance when saving data must have these privileges for all the virtual machines being backed up:
On the backup appliance, the user must have the following privileges:
The user must have these privileges for vCenter Server and all ESXi hosts involved in backup:
Global > DisableMethods and EnableMethods
All privileges must be applied at the vCenter Server level. Otherwise the error message returned will be somewhat misleading: “The host is not licensed for this feature.”
Adapter Types
The library can select the following adapters:
VIXDISKLIB_ADAPTER_IDE – Virtual disk acts like ATA, ATAPI, PATA, SATA, and so on. You might select this adapter type when it is specifically required by legacy software.
VIXDISKLIB_ADAPTER_SCSI_BUSLOGIC – Virtual SCSI disk with Buslogic adapter. This is the default on some platforms and is usually recommended over IDE due to higher performance.
VIXDISKLIB_ADAPTER_SCSI_LSILOGIC – Virtual SCSI disk with LSI Logic adapter. Windows Server 2003 and most Linux virtual machines use this type by default. Performance is about the same as Buslogic.