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.
Always check the Virgo logs when things don't work as expected. Search with your plugin-package id and it should tell you what the problem is.
How do I download the Virgo logs from the VMware vCenter Appliance ?
Assuming your development environment is windows ...
You can use WinSCP to navigate through the file system of the VCVA (VMware vCenter Virtual Appliance). You can use the same tool to download any file from there.
You can use putty to login to the VCVA and use vi to look into the log file.
You can use VMRC ( VMware Remote Console) to login to VCVA and use vi to look into the log file.
after looking at the logs it seems the download of the zip file was blocked because the url to the zip was http (instead of https)
I added allowHttp = true to the webclient.properties but now I am seeing a different error in the virgo logs which have me stumped.
[2014-02-05 19:19:58.089] [ERROR] vc-service-pool-38 70000070 100002 200001 com.vmware.vise.vim.extension.VcExtensionManager Error unzipping http://<MY-SERVER-for-ZIP>/plugin/helloworld.zip to directory /var/lib/vmware/vsphere-client/vc-packages/vsphere-client-serenity/com.vmware.samples.helloworld-1.0.0, check if the server process has Write Permission on this machine. java.net.UnknownHostException: <MY-SERVER-for-ZIP>
Check that the URL http://<MY-SERVER-for-ZIP>/plugin/helloworld.zip returns a valid .zip file, i.e. one that you can download and unzip.
I am facing slightly different problem when registering the plugin. My plugin package is hosted on a HTTP URL. I have added allowHttp=true to webclient.properties. The plugin registration is successful and I can see the plugin in the Manage Plugins dialog in the vSphere C# client. However, I cannot see my plugin in the vSphere web client UI. Virgo logs indicate that the zip file cannot be opened. I browsed to the plugin url using the browser and I am able to successfully download the zip file and unzip it. I have used the Windows explorer zip functionality to create the zip file. Snippet from the Virgo server log -
[2014-02-24 01:29:27.740] [INFO ] vc-service-pool-54 | 70000148 100004 200002 com.vmware.vise.vim.extension.VcExtensionManager | Done downloading plugin package from <plugin url> |
[2014-02-24 01:29:27.748] [ERROR] vc-service-pool-54 | 70000148 100004 200002 com.vmware.vise.vim.extension.VcExtensionManager | Error unzipping <pluginurl> to directory C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\<plugin>-<version>, check if the server process has Write Permission on this machine. java.util.zip.ZipException: error in opening zip file |
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at com.vmware.vise.vim.extension.VcExtensionManager.downloadPackage(VcExtensionManager.java:428)
at com.vmware.vise.vim.extension.VcExtensionManager.access$100(VcExtensionManager.java:61)
at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:315)
at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:312)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[2014-02-24 01:29:27.749] [INFO ] vc-service-pool-54 | 70000148 100004 200002 com.vmware.vise.vim.extension.VcExtensionManager | Done expanding plugin package to C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\<plugin>-<version> |
Any other diagnostics I need to run to get to the root cause? Help would be really appreciated.
Regards,
Ashutosh
> java.util.zip.ZipException: error in opening zip file
> Any other diagnostics I need to run to get to the root cause?
We're using the standard Java ZipFile APIs, it's too bad it doesn't provide better error messages.
It seems to me that there is a problem with the downloaded file. You could try to write a small java program to unzip it.
Hi Laurent,
Thank you very much for your response. As you suggested, I wrote a sample program to download the zip file from the HTTP URL I have specified and try to open the file. I was able to download the file and unzip it. I tried running this on the server just to rule out any connectivity issues and this works fine too. Is there any particular location where the zip file gets downloaded to? The logs mention that the zip file was downloaded successfully, so I would like to confirm that the downloaded file is not corrupted. Could the issue be related to OS permissions?
Thanks & Regards,
Ashutosh
The zip file is downloaded in the default temporary directory for the JVM but not kept around.
The error message says "Error unzipping <pluginurl> to directory C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity\<plugin>-<version>, check if the server process has Write Permission on this machine", did you check that?
Hi Laurent,
The web client service runs under the Local System account and the System account has full read-write access to C:\ProgramData\VMware\vSphere Web Client\vc-packages\vsphere-client-serenity folder. Is there any other folder that I need to check the access control on? My setup is a all in one setup with all 4 components (SSO, Inventory service, vCenter server and web client server) installed on the same host. My server is not part of any domain. Will that make any difference?
Regards,
Ashutosh
My hunch is that there is something about the zip file that Java ZipFile code doesn't like. Try packaging one of the SDK samples, try also to create your plugin zip with another utility than Windows Explorer.
I tried a couple of different zip programs like WinZip and Ant Zip. I get the same error every time.
I did a search on "zip" to find out the binary vCenter uses for zipping and unzipping and I found various binaries called zip.exe with different sizes. There were also a bunch of zip.dlls. Which one should I use to zip the file to ensure that the file can be unzipped successfully? Any clues?
Regards,
Ashutosh
I tried packaging the helloworld sample and got the same error.
As I explained earlier we are using the standard Java ZipFile APIs to unzip the package file, so it is the JVM used by the Virgo server. It must be something specific to your setup that causes this error because we haven't had any other bug report on this issue and everyone goes through the same plugin package installation process.
Thanks for your time Laurent. It is very highly likely that the issue is with my setups (or maybe it is something silly I am doing ).
Regards,
Ashutosh
This is in reference to the java program. I am facing many compile time error in that. Could you please help me to resolve them ?
Cannot invoke add(KeyValue) on the array type KeyValue[] RegisterPlugin.java /PluginInstaller/src/xyz line 263 Java Problem
Cannot invoke add(KeyValue) on the array type KeyValue[] RegisterPlugin.java /PluginInstaller/src/xyz line 262 Java Problem
Cannot invoke add(ExtensionClientInfo) on the array type ExtensionClientInfo[] RegisterPlugin.java /PluginInstaller/src/xyz line 251 Java Problem
NotFoundFaultMsg cannot be resolved to a type RegisterPlugin.java /PluginInstaller/src/xyz line 230 Java Problem
Cannot invoke add(ExtensionResourceInfo) on the array type ExtensionResourceInfo[] RegisterPlugin.java /PluginInstaller/src/xyz line 276 Java Problem
Cannot invoke add(KeyValue) on the array type KeyValue[] RegisterPlugin.java /PluginInstaller/src/xyz line 275 Java Problem
Cannot invoke add(KeyValue) on the array type KeyValue[] RegisterPlugin.java /PluginInstaller/src/xyz line 274 Java Problem
Cannot invoke add(ExtensionResourceInfo) on the array type ExtensionResourceInfo[] RegisterPlugin.java /PluginInstaller/src/xyz line 264 Java Problem
The method setLastHeartbeatTime(Calendar) in the type Extension is not applicable for the arguments (XMLGregorianCalendar) RegisterPlugin.java /PluginInstaller/src/xyz line 286 Java Problem
RuntimeFaultFaultMsg cannot be resolved to a type RegisterPlugin.java /PluginInstaller/src/xyz line 289 Java Problem
RuntimeFaultFaultMsg cannot be resolved to a type RegisterPlugin.java /PluginInstaller/src/xyz line 227 Java Problem
The method getVimPort() is undefined for the type VimPortType RegisterPlugin.java /PluginInstaller/src/xyz line 160 Java Problem
VimService cannot be resolved to a type RegisterPlugin.java /PluginInstaller/src/xyz line 159 Java Problem
I have a slightly be related issue. The plugin doesn't install properly and I'm seeing this in the log. Any hints?
Thanks in advance!
{log}
[2015-04-01 22:20:49.456] [INFO ] vc-service-pool-106883 70030789 100138 200036 com.vmware.vise.vim.extension.VcExtensionManager Downloading plugin package from https://localhost/ (no proxy defined)
[2015-04-01 22:20:49.462] [ERROR] vc-service-pool-106883 70030789 100138 200036 com.vmware.vise.vim.extension.VcExtensionManager Error unzipping https://localhost/ to directory /var/lib/vmware/vsphere-client/vc-packages/vsphere-client-serenity/com.xyz.plugin, check if the server process has Write Permission on this machine. javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Server certificate chain is not trusted and thumbprint doesn't match
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at com.vmware.vise.util.http.ConnectionManager.connect(ConnectionManager.java:184)
at com.vmware.vise.util.http.SimpleHttpClient.connect(SimpleHttpClient.java:182)
at com.vmware.vise.util.http.SimpleHttpClient.executeMethodResponseAsStream(SimpleHttpClient.java:105)
at com.vmware.vise.vim.extension.VcExtensionManager.writePackageToFile(VcExtensionManager.java:474)
at com.vmware.vise.vim.extension.VcExtensionManager.downloadPackage(VcExtensionManager.java:426)
at com.vmware.vise.vim.extension.VcExtensionManager.access$100(VcExtensionManager.java:62)
at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:317)
at com.vmware.vise.vim.extension.VcExtensionManager$1.call(VcExtensionManager.java:314)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.cert.CertificateException: Server certificate chain is not trusted and thumbprint doesn't match
at com.vmware.vim.vmomi.client.http.impl.ThumbprintTrustManager.checkServerTrusted(ThumbprintTrustManager.java:150)
at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(Unknown Source)
... 25 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at com.vmware.vim.vmomi.client.http.impl.ThumbprintTrustManager.checkServerTrusted(ThumbprintTrustManager.java:133)
... 26 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 33 common frames omitted
[2015-04-01 22:20:49.462] [INFO ] vc-service-pool-106883 70030789 100138 200036 com.vmware.vise.vim.extension.VcExtensionManager Done expanding plugin package to /var/lib/vmware/vsphere-client/vc-packages/vsphere-client-serenity/com.xyz.plugin
[2015-04-01 22:20:49.504] [INFO ] http-bio-9443-exec-19 70030789 100138 200036 com.vmware.vise.security.DefaultAuthenticationProvider Session initialization complete for sessionId 100138, clientId 200036
{log}
Why is the VcExtensionManager trying to download from localhost?
"Downloading plugin package from https://localhost/https://localhost/ "
How inspect the plugin entries in the vCenter server?
The plugin-package URL in your vCenter extension is wrong, it cannot be localhost.
See the doc at docs/SDK-Tutorial.html#register-plugin-package, it also explains how to use the MOB to inspect your vCenter extensions.