As of vSphere 8.0 U1, VDDK offers direct access to a datastore, in addition to pre-existing folder path access to disk.
For direct datastore access, there is no support for snapshots and CBT. Currently only NBD/NBDSSL and HotAdd transport modes are supported. HotAdd transport does not support RDM disks. For datacenters with encrypted disks, NBDSSL transport mode is required, and clusters must activate vSphere HA to guarantee that all hosts have a crypto key ID. Steps to employ this feature are below.
VDDK header file vixDiskLib.h now has a structure definition for VixDiskLibDatastoreSpec
containing two strings: a managed object reference (MoRef) to the datastore, and a folder path to the disk. Datastore specification is enumerated as type 2 in VixDiskLibSpecType
. Programs call VixDiskLib_ConnectEx() to connect to a datastore instead of a virtual machine or first class disk (FCD). Then programs call VixDiskLib_Open() on that datastore with a folder path to open the specified disk.
- Connect to datastore.
VixDiskLibConnection theDSconn; VixDiskLibConnectParams *cnxParams = VixDiskLib_AllocateConnectParams(); connParams->specType = VIXDISKLIB_SPEC_DATASTORE; cnxParams->spec.dsSpec.datastoreMoRef = “datastore-19”; cnxParams->spec.dsSpec.diskFolder = “RHELXfsTargetClone_dest”; VixDiskLib_ConnectEx(cnxParams, ..., &theDSconn);
- Open disk on the datastore.
VixDiskLibHandle diskHdl; VixDiskLib_Open(theDSconn, /* diskPath */, /* open flags */, &diskHdl);
- Read from or write to the disk.
- Close the disk.
- Disconnect from VixDiskLib.