Datastore-Level Access to VMDK
As of vSphere 8.0 U1, VDDK offers direct access to a datastore, in addition to pre-existing folder path access to disk.
At the datastore level, there is no support for snapshots and CBT. See below for steps to employ this feature. 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.
VDDK header file
vixDiskLib.h has a new 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.