Best Practices for
Creating Plug-In Packages
To meet the
requirements of your virtual environment, you must extend the capabilities of
the
vSphere Client
by creating plug-in modules. Depending on your extension solution, you can
extend the user interface layer and the service layer of the
vSphere Client
.
Incorrect structure of the plug-in package leads
to deployment errors. To avoid these errors, consider the following best practices when
creating your plug-in packages.
- Use the generation tools provided with thevSphere ClientSDK to develop yourvSphere Clientextensions and create plug-in packages.
- Verify that the structure of the plug-in package is as follows:
- plugin-package.xml- The file describes general information about the plug-in package, the deployment order of the plug-in modules, and any dependencies upon other plug-in packages.
- pluginsfolder - The folder contains one or more JAR and WAR files that represent the user interface and Java services components. Limit the number of third-party libraries that you add to this folder.
- To avoid installation errors, make sure that all third-party libraries that you use are added inside the JAR and WAR files of the plug-in package and not inside thepluginsfolder. If you add third-party libraries to thepluginsfolder, the bundles must be OSGi-compliant. Because thevSphere Clientresides on the Tomcat Web Server, which is based on the SpringSource dm Server and is built on top of the Equinox OSGi framework, third-party libraries must be packaged as OSGi bundles. OSGi bundles must include an OSGi manifest file that contains correct and thorough OSGi metadata.
- To avoid deployment errors generated by the Tomcat server, make sure that you do not include third-party libraries that are already available on the server. You can navigate to thehtml-client-sdk/server/webapps/h5-bridge-webapp.war/WEB-INF/eclipse/pluginsdirectory to view the available libraries.
- If your plug-in package contains both user interface and Java service components, place the Java service components before the user interface components in the plug-in package manifest file. Use the<bundlesOrder>element to specify the order in which the bundles are deployed to thevSphere Client.
- For best performance, when designing yourvSphere Clientextension, limit the number of files included in thepluginsfolder of your plug-in package. Ideally, your plug-in package must contain only one WAR file, which contains the user interface plug-in modules, and one JAR file, which contains the Java service plug-in modules. Fragmenting your code into many bundles might significantly increase the deployment time and memory consumption.
- To avoid compatibility issues in case your plug-in package depends on other plug-in packages with specific versions, make sure that you define correctly the plug-in dependencies by using thematchparameter of thedependencieselement in yourplugin-package.xmlmanifest file. Otherwise, after thevSphere Clientdeploys your plug-in package, the plug-in will not work because the plug-in dependencies cannot be resolved and may cause errors in thevSphere Client.For example, you can use the following lines in the manifest file of your plug-in package to define the minimum supported version of thevSphere Client:... <dependencies> <pluginPackage id="com.vmware.vsphere.client" version="5.5.0" match=“greaterOrEqual" /> </dependencies> ...If your plug-in package is only compatible with a specific version of thevSphere Client, you must use theequalvalue of thematchattribute to specify the version. In this way, you ensure that when you upgrade thevSphere Client, your plug-in package is not deployed, and does not cause any errors.If thematchattribute is not provided, the default value isgreaterOrEqual.
- To avoid deployment failures, you must create a ZIP archive file for yourvSphere Clientextension. Moreover, if you want to complete successfully the certification for yourvSphere Clientplug-in, know that the plug-in signing tool signs only plug-ins that have the ZIP file format.
For the vSphere 8.0 release, local plug-ins must be upgraded as follows:
- Local plug-ins must be FIPS-compliant. See https://developer.vmware.com/docs/13385/preparing-local-plug-ins-for-fips-compliance
- Local plug-ins must bundle third-party libraries and installthem in a separate directory. See https://vdc-download.vmware.com/vmwb-repository/dcr-public/77dd6491-bb96-47f3-8c2e-a5a4655f078b/b916bc3c-0168-4487-a9e5-c89b50373c18/Local-Plugins-Library-Isolation.pdf