Guest SDK with HA | 2 April 2020 | SDK on code.vmware.com For vSphere 7.0 GA release | Last document update: 24 Nov 2020 Check for additions and updates to these release notes. |
About the Guest and HA Application Monitoring SDK
You can download the Guest SDK for monitoring guest virtual machine statistics, including facilities for High Availability (HA) Application Monitoring. The SDK version number is 11.0.
Guest SDK. The vSphere Guest SDK provides read-only APIs for monitoring various virtual machine statistics. Management agents running in the guest OS of a virtual machine can use this data for reacting to changes in the application layer.
HA Application Monitoring. The vSphere High Availability (HA) feature for ESXi hosts in a cluster provides protection for a guest OS and applications running in a virtual machine by restarting the virtual machine if a failure occurs. Using the HA Application Monitoring APIs, developers can write software to monitor guest OS and process heartbeat.
Compatibility Notices
New: The never-documented guest API VMGuestLib_GetHostMemKernOvhdMB is deprecated as of VMware Tools 11.2.0. The GUESTLIB_HOST_MEM_KERN_OVHD_MB performance counter that it returns was documented in vSphere Virtual Machine Administration for ESXi 5.5, but dropped in subsequent documentation.
The Guest SDK in vSphere 7.0 is compatible with VMware Tools version 11.0.x and later.
For vSphere 6.0, HA Application Monitoring communication was revised to use the VMCI (virtul machine communication interface). The VMCI driver is preinstalled in Linux kernel 3.9 and higher, and in earlier kernel versions it can be installed with VMware Tools. On Windows, VMware Tools must be installed to obtain the VMCI driver.
This SDK supports C and C++ programming languages. You can support Java with wrapper classes (JNI).
Changes and New Features
For vSphere 7.0, VMware Tools is built with the Visual Studio 2015 compiler, so the Guest SDK on Windows now depends on runtime vc140 instead of vc90.
The VMGuestLib_GetMemShares64 call was added in vSphere 7.0 to support large-memory virtual machines.
The checksystem utility to verify proper glib version was added in the vSphere 6.5 release.
Tools for fetching extended guest statistics were added in vSphere 6.0, but not publicly documented until April 2015.
In the vSphere 6.0 release, high availability VM component protection, and FT (fault tolerance) has been extended for symmetric multiprocessing (SMP). Also, the communication interface was changed to use VMCI.
Known Issues and Workarounds
The HA Application Monitoring library is not thread safe. It assumes that only one monitor process generates heartbeats in the VM. If a program runs multiple monitor threads, the library will leak memory, and RPC processes might not exit when the program terminates. Moreover, unexpected VM resets may occur owing to lack of heartbeats in a different thread. Monitoring programs should either avoid multithreading, or call the library from a single thread only.
Security enforcement for the Guest and HA application monitoring SDK using the secure authentication VMX parameter guest_rpc.rpci.auth.app.APP_MONITOR=TRUE does not work for FT (fault tolerant) VMs. The vSphere platform supports only the non-secure channel for FT virtual machines.
Sample code for HA Application Monitoring does not demonstrate use of the new API to request reset of the guest virtual machine, VMGuestAppMonitor_PostAppState.