Open a Local or Remote Disk

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.

vixError =
VixDiskLib_Open(appGlobals.connection, appGlobals.diskPath, appGlobals.openFlags, &srcHandle);

The following flags modify the open instruction:

  • VIXDISKLIB_FLAG_OPEN_UNBUFFERED – Disable host disk caching.
  • VIXDISKLIB_FLAG_OPEN_SINGLE_LINK – Open the current link, not the entire chain (hosted disk only).
  • VIXDISKLIB_FLAG_OPEN_READ_ONLY – Open the virtual disk read-only.

As of vSphere 6.5, the following additional flags are available:

  • VIXDISKLIB_FLAG_OPEN_COMPRESSION_ZLIB – Open for NBDSSL transport, zlib compression.
  • VIXDISKLIB_FLAG_OPEN_COMPRESSION_FASTLZ – Open for NBDSSL transport, fastlz compression.
  • VIXDISKLIB_FLAG_OPEN_COMPRESSION_SKIPZ – Open for NBDSSL transport, skipz compression.