The VIX API Reference guide includes function reference pages for C++, Perl, and COM (component object model) for Microsoft C#, VBScript, and Visual Basic. Most reference pages include helpful code examples. Additionally, the
vix-api Web guide includes examples for power on and off, suspending a virtual machine, taking a snapshot, guest operations, virtual machine discovery, and asynchronous callbacks.
Suppose you want to run the antivirus software presented in Scan VMDK for Virus Signatures for all virtual machines hosted on a VMware Workstation. Here is the high-level algorithm for an VIX-based application that would scan hosted disk on all virtual machines.
Your callback function must be similar to the VixDiscoveryProc() callback function shown as an example on the
VixHost_FindItems() page in the
VIX API Reference Guide.
The Developer’s Setup Guide for the VMware vSphere WS SDK has a chapter describing how to set up your programming environment for Microsoft C# or Java. Some of the information applies to C++ also.
The Programming Guide for the vSphere SDK contains some sample code written in Microsoft C# but most examples are written in Java, and based on the JAX-WS development framework.
Suppose you want to run the antivirus software presented in Scan VMDK for Virus Signatures for all virtual machines hosted on an ESXi host. Here is the high-level algorithm for a VMware vSphere solution that can scan managed disk on all virtual machines.
The VMware vSphere Web Services API (version 2 and later) offers some methods to manage VMDK files. The VirtualDiskManager managed object defines more than a dozen methods similar to those in the Virtual Disk API documented here.
For more information, navigate to the latest VMware vSphere documentation center on the Web, search for VirtualDiskManager, and follow the specific link. At top of page you can click Local Methods to see a list of all methods defined by the
VirtualDiskManager managed object.
VirtualDiskManager methods were not heavily used, and have not been updated to support object oriented file systems such as Virtual SAN (VSAN) or storage profile based management (SPBM).
To attach an FCD using the vSphere Web Client, click Edit virtual machine settings > New device: Select and add it as an Existing Hard Disk.