VMware {code} Community
dev_webclient
Contributor
Contributor
Jump to solution

Regarding registration of web client plugin package in vcenter server

Hi,

i  am able to create plugin package(.zip file), using eclipse virgo plugin and able to deploy and test the same with serenity client as specified in SDK tutorial.

To register my plugin package as an extension with vcneter server, i followed below steps:

1. using perl code of vi perl SDK, and i am able to register plugin and can view in mob as well.

But i am unable to see plugin in vcenter server.Also logs are not getting generated for web client .(Serviceability folder is not created at all.All required services are running).

Please suggest any script that i can use to deploy plugin for production phase.And also steps to generate logs.

Thanks a lot.

Tags (1)
1 Solution

Accepted Solutions
rdey
Enthusiast
Enthusiast
Jump to solution

I have attached a java program showing how to register a vSphere Web Client plugin with vCenter server. This program is not recommended to use in production as it does not verify certificates.

Also this program will work if your plugin zip file is located at a "http://" url. If your zip file is located at a "https://" url then you have to provide the server thumbprint in the server property of the

Extension Data Object. You can do it the same way the client property has been populated in the code provided. Here is the link to the Extension object where you can find all the properties of an Extension Object VMware vSphere 5.1

HTH.

View solution in original post

38 Replies
rdey
Enthusiast
Enthusiast
Jump to solution

I have attached a java program showing how to register a vSphere Web Client plugin with vCenter server. This program is not recommended to use in production as it does not verify certificates.

Also this program will work if your plugin zip file is located at a "http://" url. If your zip file is located at a "https://" url then you have to provide the server thumbprint in the server property of the

Extension Data Object. You can do it the same way the client property has been populated in the code provided. Here is the link to the Extension object where you can find all the properties of an Extension Object VMware vSphere 5.1

HTH.

dev_webclient
Contributor
Contributor
Jump to solution

Thanks a lot for reply .

This script needs to shared by developer to customer or the customer will use this script to deploy plugin.Basically who will run this java program?

I mean as developer I just have to give .zip file of plugin package to customer or do i need to share this script as well to customer to deploy plugin?

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

As plugin developer you are responsible for writing an installer program that customers will run to register your plugin-package. You don't want them to deal with running a java program directly 🙂  The installer should be user-friendly.

dev_webclient
Contributor
Contributor
Jump to solution


Thanks a lot for sharing java program.

I was trying to run the above java program,but getting error as "com.sun.xml.internal.ws.client.ClientTransportException:The server sent HTTP status code 400:Bad Request" .

I followed below steps to execute java program in my eclipse ,

1. Created my plugin package.(there by mentioning MyService )

2. In the generated plugin-package.xml,added bundle id of my plugin as,

 

     <bundle id="com.acme.myService.MyService"/>

    <bundle id="com.acme.myPlugin.MyPlugin"/>

3.Created .zip file of my plugin package.

4. In remote machine(running apache),  placed my plugin package .zip file to Apache webapp folder (i.e.,under C:\Program Files\Apache Software Foundation\Tomacat7.0\webapps\ui\plugin\myPlugin.zip )

5 .From remote machine I was trying to run java program by paasing these parameters using eclipse,

--url https://VCenterServerIp --username administrator --password VCenterServerpassword --key com.acme.myPlugin --version 1.0.0 --name PluginSmaple --summary test --comapny vmware --pluginurl http://remotemachineip:8082/ui/myPlugin.zip

I am able to debug java program and aslo verified these values getting assigned .

It is throughing above error while in connect().

Please help in this regard.Also let me know if I am missing any step.

Reply
0 Kudos
rdey
Enthusiast
Enthusiast
Jump to solution

You have to provide --url https://<VCenterSerrverIP/sdk.

Since you are using http url you have to enable http download  on the vSphere Web Client Server.

To enable download of http packages, add the following line in webclient.properties file

HTTP.DOWNLOAD = true

On Windows machine the file should be located at %PROGRAMDATA%\VMware\vSphere Web Client directory.

If the file is not present, create one. After modifying the file restart Virgo server a.k.a vSphere Web Client Server.

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

Thanks.

I added below entries to webclient.properties file,

HTTP.DOWNLOAD=true

allowHttp=true

With above changes,I can see my plugin-package(tesi-ui.zip), is unziped/extracted to vc-packages\vsphere-client-serenity folder.

i.e., C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\com.tsol.tesiui.Tesiui-1.0.0\tesi-ui\plugins


Also i can see the plugin registered in mob.But my plugin is not appearing in vcenter server.

Please help in this regard.

I am attaching vsphere_client_virgo log file.

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

My guess is that your tesi-ui.zip file is not correct so it is ignored, i.e. you fell into the typical mistake noted in the SDK-Tutorial.html:

"A typical mistake is to create a plugin package .zip with the wrong structure, i.e. with an extra folder at the root instead of the plugin-package.xml manifest as described above"

Double-check the content of tesi-ui.zip.

FYI, Web Client 5.5 provides better log messages to catch this error.

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

I corrected the .zip file.The content of tesi-ui.zip is,

                                                            |-plugins

                                                            |-plugin-package.xml

On runing java script ,plugin package is getting unzipeed to serenity folder path, C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\com.tsol.tesiui.Tesiui-1.0.0\plugins

The log file is showing Import-Package: com.tsol.tsipservice exception.

Whereas I have tested the same plugin-package(i.e., tesi-ui folder not the .zip) in test environment.And it is working properly.

Am attaching the log

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

> Java.lang.UnsupportedClassVersionError: com/tsol/tsipservice/TCService : Unsupported major.minor version 51.0

This means that you are using JDK 1.7 but not compiling with -target 1.6 as explained in the SDK doc.

All java code running in the Web Client server must be compatible with Java 1.6.

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

Yes,I am using JDK 1.7.0_07.. Smiley Happy  My JAVA_HOME and also installed JRE of eclipse is pointing to  this.

Eclipse's Java compiler preferences are set as per the SDK doc.

Is it required if to set -target 1.6 for ant build?If yes, then can you please mention where exactly i have to set -target 1.6 to compile?

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

You can add target="1.6" in the <javac ...>  Ant command.  See Javac Task

Let me know if this solves your problem.

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

Thanks a ton..

My plugin is installed successfully..Smiley Happy

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

Hi,

I want to deploy samples/chassis plugin(chassis-ui and chassisservice layer) along with myPlugin package in Vcenter server.

1. For that do I need to just modify my plugin-package.xml?

i.e.,MyPlugin's plugin-package.xml:    with bundle ids of myPlugin along with chassis bundle id,  

     <bundle id="com.acme.myService.MyService"/>

    <bundle id="com.acme.myPlugin.MyPlugin"/>

    <bundle id="com.vmware.samples.chassisui"/>

    <bundle id="com.vmware.samples.chassisservice"/>

2. myPlugin.zip should this have,samples/chassis plugin details,

like,chassis

             |-plugins

             |-plugin-package.xml

3.While deploying using java program,do I need to give key of only myPlugin.i.e.,

key com.acme.myPlugin --version 1.0.0 --name PluginSmaple --summary test --comapny vmware

What I am basically trying is,myPlugin project(ui and service has launch point in home screen shortcut and does some specific operations) .I want samples/chassis(ui and service having launch point in inventory), also to get deployed in vCenter server when I register myPlugin .

Both the plugins(i.e., myPlugin and sampls/chassis) are independent and are not interacting with each other.My intention is to deploy both plugins as single package.

I don't want to deploy one plugin at a time.

Please help..

Reply
0 Kudos
rdey
Enthusiast
Enthusiast
Jump to solution

You have to put 4 archive files in the plugins directory. 2 jar files for the services and 2 war files for the UIs.

Since the chassisui depends on chassisservice, ensure chassisservice appears before chassisui bundle in

the bundlesOrder tag

<bundlesOrder>

     <bundle id="com.acme.myService.MyService"/>

    <bundle id="com.acme.myPlugin.MyPlugin"/>
     <bundle id="com.vmware.samples.chassisservice"/>

    <bundle id="com.vmware.samples.chassisui"/>

</bundlesOrder>

Whatever value you provide in the id attribute of the <pluginPackage> tag in the plugin-package.xml file,

you should supply the same value as the key when you use the java program to register your plugin with

vCenter server.

Reply
0 Kudos
dev_webclient
Contributor
Contributor
Jump to solution

Hi,

I was able to successfully deploy my plugin earlier with vcenter server5.5.

Now when I tried to redeploy plugin by repeating same steps and with the same .zip file,it is not getting deployed.

I can see plugin is getting registered in mob but it is not creating plugin folder under vsphere-client-serenity i.e.,

i.e., C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity

I debugged the java code also and it is not throwing any exception.After running vimPort.registerExtension(),it is disconnecting.

I verified the log file.Here i could see my plugin( com.tsol.tesiui.Tesiui) not getting downloaded from apache server.

These flags are already enabled,

HTTP.DOWNLOAD=true

allowHttp=true

Also apache and vcenter services are running.

My vcenter server is in domain where there is no internet connection.Hence i enabled proxy to ensure internet connection is enabled.

I am attaching logs.Please help in this regard.

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

There is no trace of your plugin being deployed but I can't be sure you provided the whole logs since the server started:

- Stop the Web client server

- Increase the log level to DEBUG (see the FAQ doc)

- Start the server and login once

- If your plugin name doesn't appear in the logs it must because it wasn't registered correctly in with vCenter.

Reply
0 Kudos
Pramod1
Contributor
Contributor
Jump to solution

Thanks for sharing the RegisterPlugin java program.

I am trying to use it register the "helloWorld" sample provided with the VMware client SDK 5.5

I am trying to register the plugin to a VMware vCenter Apppliance ver 5.5

When providing a url to the zip file can I give the url as "file:///c:/my-plugin-plug-in.zip" ?

If I provide my zip file url as "file:///..." I am observing that when I try to register the "helloworld" plug-in RegisterPlugin exits without error by I dont see the plugin in the vCenter WebClient UI.

If I try to re-register it the registration fails.

If I try to unregister it un-registration completes.

I am not able to figure out if the zip file is uploaded or not.

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

The plugin package URL must use HTTP or HTTPS.

You can check if the extension registration succeeded by going to https://YOUR_VC_IP/mob/?moid=ExtensionManager in your browser and looking at the list of extensions.

Reply
0 Kudos
Pramod1
Contributor
Contributor
Jump to solution

I am using the "Hello World" sample that comes with the VMware client SDK 5.5

I created a virtual directory on my IIS server and was able to create a url for the zip

I verified the url works by typing it in Chrome, when I hit enter, it downloads the zip file.

Now when I run the RegisterPlugin java program

I can see the extension listed under  https://YOUR_VC_IP/mob/?moid=ExtensionManager

However when I go to the vCenter WebClient I dont see the Hello World extension.

In case it matters --> I created the zip file using Winzip since I couldnt find in the documentation if it needs winzip/7zip/... ???

Inside the zip I have plugin-package.xml and a folder "plugins"

In the folder "plugins" I have 2 war files [helloworld-ui-war-5.5.0.war] & [helloworld-i18n-ui-war-5.5.0.war]

How do I check if the zip was downloaded correctly when registerExtension was called ?

Do I need to restart the vCenter Appliance for the plug-in to show ?

Reply
0 Kudos