vSphere Web Client SDK Setup

Table of content:

  1. Development Environment
  2. Virgo Server Setup
  3. vCenter Server Registration
  4. Web Browser setup
  5. Start and Run
  6. Software Requirements Summary
  7. Mac OS Setup notes and tips

Introduction

The SDK package can be installed on Windows or Mac OS. It contains the libraries, docs and samples necessary for getting started and building your own UI and Service plug-ins, and also the server component (Virgo) and Web Client bundles used to run and test your plug-ins locally. See the README for an overall description of the SDK files.

Always use a top directory without spaces for the root directory of the SDK package, for instance C:\VMware\vsphere-client-sdk, because long paths or paths containing spaces may cause server deployment errors and script errors.

You must have access to vCenter Server 6.0 for Windows or the VCSA appliance in order to complete this setup.

Most of the instructions below are common to Flex and HTML plug-ins development.

1. Development Environment

Java JDK

Ant

Ant is used by default to build the SDK samples but you are not required to use Ant in your own environment:

See the Mac OS Setup notes at the end for tips on setting environment variables.

IDEs (Eclipse, STS and others)

Which IDE to choose?

  1. Eclipse JEE is the recommended IDE because of its Virgo integration and the SDK Tools Eclipse Plug-in.
  2. Spring Tool Suite (STS) can be used the same way as Eclipse since it is a superset, offering additional developer tools that you may be interested in.
  3. IntelliJ IDEA is a good IDE. The "ultimate" version includes a Flex debugger.
  4. Any editor will work :-)

If you are developing Flex plugins do not use the version of Eclipse that comes with FlashBuilder. Install Eclipse first, then install FlashBuilder as a plugin to Eclipse .

Eclipse and STS setup

Add these 2 lines to tell Eclipse to use your installed JDK. Remove any space before each line! (on Mac OS, this is not necessary if you used the Java Preferences app to set the correct JDK as default)

-vm
C:/<your JAVA_HOME directory>/bin/java.exe

Add or change these VM arguments to increase memory (more is even better if you can afford it):

-Xmx1024m
-XX:MaxPermSize=512m

In order to build SDK examples you need to set two VSPHERE_CLIENT_SDK variables. (We recommend that you use VSPHERE_CLIENT_SDK as well in your new Flex and Java projects in order to avoid hard-coding the location of the SDK and make your projects portable):


Flash Builder and Flex SDK

Adobe Flash Builder is not required for building HTML plugins or even for compiling Flex code, the Flex compiler is included in the Flex SDK. However if you are building Flex UI plugins it is recommended to install Flash Builder in order to take advantage of the debugger and have a better development experience within Eclipse. The other solution is to use IntelliJ IDEA "ultimate" version which includes a Flex debugger.

If you don't install Flash Builder you still need to install the free Flex SDK separately, even for HTML plugins.

Flash Builder

Flex SDK

Install the Flex SDK either for building HTML plugins (required to compile resources), or for building Flex plugins without Flash Builder.

Check if the file $FLEX_HOME/frameworks/libs/player/11.5/playerglobal.swc is not present otherwise you need to download it separately:

SDK Tools Eclipse Plug-in

The vSphere Web Client SDK includes an Eclipse plug-in with various tools to help your Web Client development, including a wizard to create Flex and Java plug-in projects easily.

Before trying to installing new software make sure that Eclipse's Network Connections settings are correct, otherwise the UI won't be responsive.
If your work location requires a proxy go to Window > Preferences > General > Network Connections to set it up.

After you restart Eclipse you can verify that the plugin is correctly installed:

For more information on how to use this wizard please see the SDK-Tutorial doc.

2. Virgo Server setup

In order to use the Virgo server in the Eclipse IDE during development you must install the Eclipse Virgo Tools:

There is a known issue installing Virgo tools with Eclipse 4.4 (Luna) or STS 3.6. A work-around is provided in this Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=438506.

Once you have restarted Eclipse:

In the next screen, for the installation directory, select the server directory inside your SDK folder.
(The message "Valid installation" will popup at the top once you select the right directory). You can leave the default server name as is.

Finally you should increase the memory used by the Virgo Server process:

-XX:+CMSClassUnloadingEnabled
-XX:MaxPermSize=256m

For more information see the Virgo Guides available through Help > Help Contents.

3. vCenter Server Registration

Web Client 6.0 is compatible with vCenter servers version 5.5 and 6.0 but you need at least one vCenter server 6.0 for the initial registration.

The vCenter installation requires an SSO server (Single Sign-On) for authentication: vCenter registers with the SSO server and with Component Manager (CM). The Web Client finds the registered vCenter(s) at login time when it connects to CM. In order to configure your development environment to use the proper CM and SSO you need to generate two registration files with the scripts dev-setup.sh or dev-setup.bat in /tools/Dev setup scripts (vCenter registration)/.

Registration with vCenter 6.0

Note: to copy files between your development machine and VCSA or vCenter Server for Windows you can use WinSCP on Windows and Cyberduck on Mac OS (or the ssh command line).

  1. For VCSA: copy dev-setup.sh to your VCSA root directory and make it executable.
    For vCenter for Windows: copy dev-setup.bat to vCenter for Windows administrator directory.
  2. Run the dev-setup script. Three files get generated: webclient.properties, store.jks and ds.properties.
  3. Copy these files to your dev machine at the following locations:
    1. webclient.properties
      Windows: C:/ProgramData/VMware/vCenterServer/cfg/vsphere-client/
      Mac OS: /var/lib/vmware/vsphere-client/
    2. store.jks
      Windows: C:/ProgramData/VMware/vCenterServer/cfg/
      Mac OS: /var/lib/vmware/vsphere-client/
    3. ds.properties
      Windows: C:/ProgramData/VMware/vCenterServer/cfg/vsphere-client/config/
      Mac OS: /var/lib/vmware/vsphere-client/config/
  4. Define the VMWARE_CFG_DIR environment variable pointing to the following location:
    Windows: C:/ProgramData/VMware/vCenterServer/cfg/
    Mac OS: /var/lib/vmware/vsphere-client/
  5. (Mac OS only) Change keystore.jks.path in webclient.properties to use the correct path for Mac OS, i.e. /var/lib/vmware/vsphere-client/store.jks
  6. (Mac OS first time only) Edit vsphere-client-sdk/server/configuration/tomcat-server.xml:
    replace
    keystoreFile="C:/ProgramData/VMware/vCenterServer/cfg/store.jks"
    with
    keystoreFile="/var/lib/vmware/vsphere-client/store.jks"
  7. Start/restart the Virgo server on your machine. The log should show a successful connection to the CM url defined in webclient.properties.

Tip: if you are developing on Mac OS and want to avoid updating keystore.jks.path each time you generate the files you can modify the script dev-setup.sh or dev-setup.bat to echo the correct path.

Registration with another vCenter 6.0

Repeat the steps above for another VCSA or vCenter Server for Windows setup. It is recommended to make a copy of the vSphere Web Client directory (Windows) or vsphere-client (Mac OS) beforehand and empty the current one, since other files get generated at runtime in this local cache. This way you can easily switch between different vCenter setups, by renaming the directory and restarting the Virgo server.

Configuration parameters in webclient.properties

webclient.properties contains various configuration flags. The copy that gets generated by the dev-setup scripts for your local Windows or Mac OS development machine contains only a subset of the parameters that can be used. See the full version in your VCSA or vCenter for Windows setups at /etc/vmware/vsphere-client/webclient.properties or C:\ProgramData\VMware\vCenterServer\cfg\vsphere-client\webclient.properties.

4. Web Browser Setup

The last step is to setup your browser for Flex development. Flex is supported by all major browsers: Internet Explorer, Firefox, Google Chrome, and also Safari on Mac.

5. Start and Run

Now that you have configured your environment let's run a simple example to make sure everything is working.

Add the Helloworld plug-in

Import the example helloworld-ui in Eclipse and add if to your server:

The project is built automatically if you kept the option Project > Build Automatically selected. See the build output in war/target/helloworld-ui-war.

Sdk-helloworld-ui.png

The next step is to deploy this plugin to the Virgo Server within Eclipse.
(In case vSphere Web Client server is already running outside Eclipse on this machine stop the server now in the Windows Services panel. The same instance will be started from Eclipse.)

Sdk-virgo-addremove.png

Sdk-virgo-addremove2.png

The plugin bundle is now visible under the Virgo server

Sdk-virgo-addremove3.png

Next you must create a Run/Debug Configuration to launch the vSphere Client:

Sdk-debugconfig.png

Start vSphere Client

Sdk-virgo-start.png

The server takes a couple of minutes to start, the Console tab shows all the bundles being loaded and should be clean of errors.

The bundles loaded by the server are both the runtime bundles installed in server/repository and the plug-ins' Flex and Java bundles from vsphere-client-sdk/vsphere-client/plugin-packages.

In case your server never reaches the state Started, Synchronized, or you see other errors, please check the trouble-shooting steps in the FAQs.

Sdk-redeploy-helloworld.png

Launch the vSphere Client

Use the Debug or Run menu to start the vSphere-client configuration you created above.

Or you can also right-click on the project and select Debug As/ Run As > Web App

Sdk-debug-webapp.png

It will appear as a short-cut in the Run or Debug menu only after your have used it once.

Sdk-debug-shortcut.png

Notes:

Your target browser is launched and lands in the login page.

Try other plug-ins

Once the Virgo server is running you can add and remove plug-ins without having to restart it.


6. Software Requirements Summary

 

Components Minimum versions Downloads Comments
Java JDK 1.7.0_17 + Java SE Downloads Java compiler must be set to 1.6 compatibility. Set JAVA_HOME to the JDK location.
Apache Ant 1.7.1 + ant.apache.org Set ANT_HOME to the ant directory.
Eclipse JEE
or STS
Eclipse indigo (3.7.x) +
Spring Tool Suite 2.9.x +
eclipse.org
Spring Tool Suite
64-bits versions OK with Flash Builder 4.7
Be sure to download Eclipse IDE for Java EE Developers, not the smaller Java package
Eclipse Virgo Tools 1.0.0.201207122033 See Virgo setup instructions above for installing in Eclipse
vSphere Client SDK Tools (your SDK version) Provided with the SDK See SDK Tools Eclipse Plug-in above for installing in Eclipse
Flash Builder 4.7 Adobe Flash Builder Only required for Flex UI development.
60 days trial available. Must be installed as a plug-in to Eclipse 4.2.
Flex SDK 4.6 (only) Included with FB 4.7
or Flex SDK download
Either Adobe Flex SDK or the Open Source version. Set FLEX_HOME to the sdk directory.
Flash Player
+ Content Debugger
11.5 + Flash player download Install Flash player and its Content Debugger in the browser of your choice.
Google Chrome or Firefox are recommended for HTML/JavaScript development.
IntelliJ IDEA Ultimate edition IntelliJ IDEA Alternative to Eclipse for Java/JavaScript/Flex development. A Flex debugger is included in the ultimate edition


7. Mac OS notes and tips

Here are some important things to remember when setting up your development environment on Mac OS:

See also: FAQs - SDK Tutorial - SDK samples - Flex API docs - Java API docs