Virtual Disk API Programming Guide - Documentation - VMware
Virtual Disk API Programming Guide - Documentation - VMware
Virtual Disk API Programming Guide - Documentation - VMware
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Virtual</strong> <strong>Disk</strong> <strong>Programming</strong> <strong>Guide</strong><br />
C++ on Linux Systems<br />
Find the sample source in this directory:<br />
/usr/share/doc/vmware-vix-disklib/samples/diskLib<br />
You can copy vix<strong>Disk</strong>LibSample.cpp and its Makefile to a directory where you have write permission, or<br />
switch user to root. On some Linux systems you need to add #include statements for and<br />
after the #else clause on line 15. Type the make command to compile. Run the application:<br />
make<br />
./vix-disklib-sample<br />
NOTE If this fails, edit /etc/ld.so.conf and run ldconfig as root or change your LD_LIBRARY_PATH<br />
environment to include the library installation path, /usr/lib/vmware-vix-disklib/lib32 (or lib64).<br />
Makefile<br />
The Makefile fetches any packages that are required for compilation but are not installed.<br />
Library Files Required<br />
The virtual disk library comes with dynamic libraries, or shared objects on Linux, to simplify the delivery of<br />
third‐party and open source components.<br />
Windows requires the lib/vix<strong>Disk</strong>Lib.lib file for linking, and the bin/*.dll files at runtime.<br />
Linux uses .so files for both linking and running.<br />
Usage Message<br />
Running the sample application without arguments produces the following usage message:<br />
Usage: vixdisklibsample command [options] diskPath<br />
commands:<br />
-create : creates a sparse virtual disk with capacity specified by -cap<br />
-redo parentPath : creates a redo log 'diskPath' for base disk 'parentPath'<br />
-info : displays information for specified virtual disk<br />
-dump : dumps the contents of specified range of sectors in hexadecimal<br />
-fill : fills specified range of sectors with byte value specified by -val<br />
-wmeta key value : writes (key,value) entry into disk's metadata table<br />
-rmeta key : displays the value of the specified metada entry<br />
-meta : dumps all entries of the disk's metadata<br />
-clone sourcePath : clone source vmdk possibly to a remote site<br />
-readbench blocksize: do read benchmark on a disk using the specified I/O block size in sectors<br />
-writebench blocksize: do write benchmark on disk using the specified I/O block size in sectors<br />
options:<br />
-adapter [ide|scsi] : bus adapter type for 'create' option (default='scsi')<br />
-start n : start sector for 'dump/fill' options (default=0)<br />
-count n : number of sectors for 'dump/fill' options (default=1)<br />
-val byte : byte value to fill with for 'write' option (default=255)<br />
-cap megabytes : capacity in MB for -create option (default=100)<br />
-single : open file as single disk link (default=open entire chain)<br />
-multithread n: start n threads and copy the file to n new files<br />
-host hostname : hostname / IP addresss (ESX 3.x or VC 2.x)<br />
-user userid : user name on host (default = root)<br />
-password password : password on host<br />
-port port : port to use to connect to host (default = 902)<br />
-vm vmPath=/path/to/vm : inventory path to vm that owns the virtual disk<br />
-libdir dir : Directory containing vix<strong>Disk</strong>LibPlugin library<br />
-initex configfile : Use Vix<strong>Disk</strong>Lib_InitEx<br />
-ssmoref moref : Managed object reference of VM snapshot<br />
-mode mode : Mode string to pass into Vix<strong>Disk</strong>Lib_ConnectEx<br />
-thumb string : Provides a SSL thumbprint string for validation<br />
The -thumb option is a new security‐related feature in the VDDK 5.1 release. See “SSL Certificate Thumbprint”<br />
on page 48.<br />
44 <strong>VMware</strong>, Inc.