VI SDK General

VI SDK General

What can I do to avoid receiving a SocketTimeout exception while executing WaitForUpdates?

SDK users must code their clients to accept SocketTimeout and retry the WaitForUpdates operation. Also, if you are using Axis, you can set the timeout on a Java stub.

VimPortType service = serviceLocator.getVimPort(new URL(urlStr));

//Example, set socket timeout to 30 minutes or 1800 seconds.

((org.apache.axis.client.Stub)service).setTimeout(1800000);

// or no timeout

//((org.apache.axis.client.Stub)service).setTimeout(0);

Where are the server side log files?

See the Basic System Administration documentation’s External System Logs section for details. The document is available at The document is available at VMware Docs

Can VirtucalCenter inventories have virtual machines that are not associated with a host?

Virtual machines (or virtual machine files) must be stored in a datastore. A datastore can be host independent, but to run a virtual machine, that virtual machine must be associated with a valid host.

What is the minimal interval between calls if I am collecting performance data?

No specific recommendation exists. Note that if the pulling interval is short, it might hurt performance.

What are the VMware Tools within the Guest Operating System?

See the Basic System Administration documentation’s “Installing and Upgrading VMware Tools” section. The document is available at VMware Docs.

Can a VMware VirtualCenter 2.0 client communicate with VMware ESX 3.5?

Yes, but the client must talk to a VMware VirtualCenter Server that can connect and communicate with VMware ESX 3.5.

Do we need to recompile the client side code that was created using 2.0 SDK with 2.5 SDK libraries? Is any porting needed?

No, you do not need to recompile and no extra porting is needed.

Can VI SDK 2.5 based clients communicate to 3.0.1 VMware ESX server?

Yes, through VMware VirtualCenter Server 2.5.

Which versions of Apache Axis and Sun’s JDK are used to generate and compile the VI SDK client stub in Java?

Please see the Installation Guide for VMware Infrastructure SDK 2.5, chapter “Setting Up for Java Development”, section “Requirements.”

What programming languages are supported by the VMware® Infrastructure SDK?

Please see the Installation Guide for VMware Infrastructure SDK 2.5, chapter “Introducing the VMware Infrastructure SDK”, section “Programming Language Support by the VI SDK” and chapter “Setting Up for Java Development”, section “Requirements”.

How can a virtual machine use multiple IP addresses?

By assigning multiple network adapters.

Can administrator passwords be changed in the virtual machine cloning process?

When Windows virtual machines are customized during a cloning process, the administrator password can be changed if the conditions described in the following sections are met.

Guest customization requires that the source virtual machine used to create the clone or templates has the following virtual hardware:

  • VMware Tools installed

  • At least one network interface card (NIC) configured – When a virtual machine is cloned or used for a template, the new virtual machine has the same number and type of NICs, for example, AMD VLance/PcNet compared with high-performance VMware vmxnet. This cannot be changed during the deployment or guest customization process.

  • SCSI disks – VirtualCenter customization operates on the disk attached to the virtual SCSI node with the lowest address on the SCSI controller with the lowest index. As a result, you must make sure that the guest operating system being customized resides on a disk attached as SCSI 0:0 node in the virtual machine configuration, as follows:

    • Windows guest operating systems – Both the active partition (the partition containing boot.ini) and the system partition (the partition containing the system directory, for example, \WINNT or \WINDOWS), must be on the same virtual disk and attached the SCSI 0:0 virtual SCSI node. Active and system partitions do not have to be the on same partition.

    • Linux guest operating systems – The virtual disk containing the system partition (the partition containing the /etc directory) must reside on the SCSI 0:0 nodes.

  • Hardware correspondence – 32-bit or 64-bit hardware on the source virtual machine must correspond to the 32-bit or 64-bit operating system being installed. Guest customization of a Windows guest operating system can occur if these conditions are met: The guest operating system is not a primary or backup domain controller.*

  • The clone or template has one of the following Windows versions installed:

    • Windows 2000 Server, Advanced Server, or Professional

    • Windows XP Professional

    • Windows Server 2003, Web, Standard, or Enterprise Editions

  • Microsoft Sysprep tools are installed on the VirtualCenter server

Windows XP Home or Windows NT4 operating system guest customization is not supported. Guest customization of 64-bit Windows operating systems is not supported

Does Vista support MKS controllers?

If your system contains the older version of quickMksAx.dll i.e 2.0.0.0 in the WINDOWS\Downloaded Program Files folder, the MKS controller does not work. Newer versions, such as 2.0.1.0, must be registered using the command regsvr32 quickMksAx.dll.

Is it possible to submit a power operation to a virtual machine with the MKS controller?

No. If you want to do this, you must use one of the other SDKs for issuing operations that affect VM state. The MKS controller is used strictly for the mouse, keyboard, and screen.

How do I control the visibility of CustomFields in VMware Infrastructure Client?

A CustomField created in VirtualCenter always appears in VI Client. Currently, no feature is available to control this.

How I change a virtual disk’s label?

This feature is not available in current version.

In thinprovisioning, how disk determined file size can be compared to total size of disk?

No direct way to do, except by checking the VMDK file size via a standard DataStoreSearch and could compare the allocated bytes of the File with the capacity noted by the VirtualDisk. Sample code for reference.

Do VMware APIs support sessions time out?

Yes, just like other HTTP services.

Can client session timeouts be configured using VMware Infrastructure Client?

Yes.

What is the default value for client session timeout?

30 seconds.

What happens if an uncompleted SOAP message is sent to a host?

This known issue is fixed in VMware ESX 3.0.2.

How can I retrieve translated events or tasks based on a locale?

This functionality is not currently available.

How can I obtain the raw values on which some metrics are calculated?

Raw numbers are available in vmPerl but by using VI API PerfQuerySpec with direct connections to VMware ESX 3.x only and parameter can be retrieved. There needs some interpolation conversion from milliseconds to seconds, or bytes to KB which can be related back to vmPerl data.

intervalId = 0;

maxSamples = 1;

startTime = NOT SET

endTime = NOT SET

What is the relevance of the key value associated with an event?

The key property is associated with the event. This contains the eventid. This key is not static or predetermined and is populated at the time the event occurs.

What might cause QueryPerf to return corrupted XML?

XML might be corrupted while manipulating data returned from an API into XML format for a customize usage, or while parameters are being passed to the API extracted from the XML.

What might cause poor performance when calling RetrieveProperties in asp.net for ~500 objects?

There might be two reasons:

A. Time taken during connecting itself being the reason for a slow down.

B. XML Serialization.

Why might I encounter a SOAP error while running the code for cloning virtual machines in Java?

Make sure you are using Axis 1.4, which is the tested version.

How can I set up my development system to have access to VMware and CIM classes?

VMWare ESX server 3.0 and above (COS full version) ship with Pegasus installed and turned on by default. Pegasus is the CIM server (or CIMOM).

What approach needs to be taken to generate the classes or wrappers using mgmtclassgen?

You can write your own CIM clients that talk to Pegasus or use CIM client utilities, for example, WbemCLI or Pegasus client library.

No issues exist when writing with C# with mgmtclassgen or using MOF to build an object model. MOF is available in the downloaded zip package.

What precautions need to be taken for creation of multiple disks?

The unit number must be unique for each device attached to a controller. Normally, two devices on the same controller cannot be assigned the same unit number.

unitNumber* - xsd:int - Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).

What might cause the error Number of virtual devices exceeds the maximum for a given controller?

This error occurs when multiple devices with same unit number are attached with a controller.

Why might the getguestinfo parameter fail to retrieve a variable?

The issue is with vmware-cmd, which is part of the Scripting API (or VmPerl). These are now legacy interfaces and VMware has no plans to update this package in the near future. Use the VI Perl Toolkit to retrieve a variable.

Why isn’t a VirtualCenter created when a DRS recommendation is created?

In general, the recommendations that are given by DRS are applied on the basis of the automation level set for the DRS cluster. For the manual setting, administrators must apply the recommendations at their discretion. For partial automated settings, the DRS automatically places the virtual machine on a host based on the resources available when the virtual machine is powered on. For the running virtual machines, it makes recommendations and administrators decide whether to follow those recommendations. For the fully automated setting, DRS makes all migration decisions based on the migration threshold set by the administrator.

How can I get DRS migration recommendation alerts?

You can use either the VI Client or the VI SDK.

Can I add variables in VMX?

This feature is not currently available.

How can I determine VMDK file sizes?

Attached is the sample code for reference.

Version history
Revision #:
1 of 1
Last update:
‎08-22-2008 01:24 PM
Updated by: