13 Replies Latest reply on Nov 13, 2012 8:09 PM by ravirangappa

    Legacy Script Plugins in Web Client

    roffer12 Novice

      On page 91 of vSphere Web Client Extension Programming Guide - version 5.1 the following text appears

       

      The vSphere Web Client provides partial support for script plug-ins that you have created for previous

      versions of the Windows-based vSphere Client application. To use your vSphere Client script plug-ins with

      the vSphere Web Client, you must convert the script plug-in’s XML configuration file to a format compatible

      with the vSphere Web Client. The vSphere Web Client SDK contains a utility that performs this

      transformation.

       

      Where is the utility tool that performs this - nothing obvious in the SDK.

       

      Or where can I find documentation on the expected XML format, post transformation.

       

       

      Thanks,

       

       

      richard.

        • 1. Re: Legacy Script Plugins in Web Client
          roffer12 Novice

          The documentation is somewhat incorrect - I did not need a tool to convert the XML.

           

           

          I registered the exact same XML plugin using my existing (product based) approach with the vCenter Server.

           

           

           

          Then edited the file /var/lib/vmware/vsphere-client/webclient.properties in the Linux appliance

           

          and added the line

           

          scriptPlugin.enabled = true

           

          restarted the vsphere-client server and hey presto, my script-based plugin was there.

           

           

          Still needs to be tested....

          • 2. Re: Legacy Script Plugins in Web Client
            laurentsd Master
            VMware Employees

            You're right, there is no transformation tool, it's built-in the vSphere Web Client once you set the flag scriptPlugin.enabled = true

            Thanks for reporting the doc issue!

            • 3. Re: Legacy Script Plugins in Web Client
              ravirangappa Novice

              We are having problems seeing our script plugin within the web client using this method.

              Our script plugin is active at the host and the cluster levels and is registered with this extension format:

               

              <extension>
                  <description>
                      <label></label>
                      <summary></summary>
                  </description>
                  <key>key</key>
                  <type>com.vmware.vim.viClientScripts</type>
                  <version>1.0.0</version>
                  <server>
                      <description>
                          <label>Plugin Label</label>
                          <summary></summary>
                      </description>
                      <company></company>
                      <type>com.vmware.vim.viClientScripts</type>
                      <adminEmail></adminEmail>
                     <serverThumbprint>0A:D6:D0:6A:61:67:90:DB:48:81:78:CE:DF:BC:D2:5C:19:F9:A0:42</serverThumbprint>
                  </server>
                  <client>
                      <version>1.0.0</version>
                      <description>
                          <label>Plugin Label</label>
                          <summary></summary>
                      </description>
                      <company></company>
                      <type>com.vmware.vim.viClientScripts</type>
                  </client>
                  <lastHeartbeatTime>2008-12-12T12:59:26.234375Z</lastHeartbeatTime>
              </extension>

               

              The URL in turn returns the configuration necessary to load the plugin:

               

              <scriptConfiguration  version="1.0">

                <key>key</key>
                <description>desc</description>
              <view  parent="Inventory.Cluster">
                <title locale="en">RR Product</title>
                </view>
              <view parent="Inventory.HostSystem">
                <title locale="en">PluginLabel</title>
              </view>
              </scriptConfiguration>

               

              We see from the virgo server logs that the plugin was deployed successfully.

              However, we do not see the tab when we select a host/cluster in the web client.

               

              1. Is there something else that needs to be added to the extension data?
              2. Where exactly are we supposed to find the classic Solutions tab as suggested by the documentation here - http://pubs.vmware.com/vsphere-51/topic/com.vmware.wcsdk.pg.doc/LegacyPlugins_Appendix.16.3.html. Can someone please post a screenshot?

               

              Thanks in advance.

              • 4. Re: Legacy Script Plugins in Web Client
                laurentsd Master
                VMware Employees

                ravirangappa,

                Do you see anything else in the Virgo logs related to your plugin?

                • 5. Re: Legacy Script Plugins in Web Client
                  ravirangappa Novice

                  Nothing apart from the deployer references.

                   

                  I have attached the logs for your reference.

                  Please look for the plugin id "com.abc.product.RRhb".

                  The logs have been extracted from load upto the point a host is selected in the inventory.

                  I have also attached the screenshot of the loaded web client.

                  Where exactly at the host level should the script plugin show up?

                  Another tab in the same level as the Summary, Monitor, Manage, Related-Objects tabs?

                   

                  Thanks so much for taking the time to check on this.

                  • 6. Re: Legacy Script Plugins in Web Client
                    laurentsd Master
                    VMware Employees

                    Just noticed that you should use <extension> instead of <view> in the definitions below:

                     

                    <view  parent="Inventory.Cluster">
                      <title locale="en">RR Product</title>
                    </view>
                    • 7. Re: Legacy Script Plugins in Web Client
                      laurentsd Master
                      VMware Employees

                      May be <view> was an old syntax, here is the doc for vSphere Client 4.1 and 5.0 script plugins:

                      https://www.vmware.com/support/developer/vc-sdk/vcplugin/vSphere_Plugin_4_1_Technote.pdf

                      • 8. Re: Legacy Script Plugins in Web Client
                        ravirangappa Novice

                        I did notice that difference when I went through the technical note referrred to in the vmware documentation [https://www.vmware.com/support/developer/vc-sdk/vcplugin/vSphere_Plugin_4_1_Technote.pdf]

                         

                        I have already tried changing "view" to "extension" and it still did not help showing the plugin in the web client.

                         

                        The logs show a parsing error when deploying the plugin with "extension":

                         

                         

                        2012-11-12 23:38:12.670] ERROR [ERROR] session-init-pool-9          97253EC36816B80CC3912728577F4A27 System.err                                                        [Fatal Error] plugin.xml:15:24: The element type "extension" must be terminated by the matching end-tag "</extension>".
                        [2012-11-12 23:38:12.670] ERROR [ERROR] session-init-pool-9          97253EC36816B80CC3912728577F4A27 com.vmware.vise.extensionfw.impl.PackagesDeployer                 Error processing script plugin package - com.abc.product.RRhb java.io.IOException: org.xml.sax.SAXParseException: The element type "extension" must be terminated by the matching end-tag "</extension>".
                        at com.vmware.vise.extensionfw.impl.PluginManifestParser.getPluginManifest(PluginManifestParser.java:60)
                        at com.vmware.vise.extensionfw.ExtensionManager.addPlugin(ExtensionManager.java:707)
                        at com.vmware.vise.extensionfw.impl.PackagesDeployer.deployScriptPlugin(PackagesDeployer.java:163)
                        at com.vmware.vise.extensionfw.impl.PackagesDeployer.deployInternalPlugins(PackagesDeployer.java:181)
                        at com.vmware.vise.extensionfw.impl.PackagesDeployer.deployPackage(PackagesDeployer.java:133)
                        at com.vmware.vise.extensionfw.impl.PackagesDeployer.deploy(PackagesDeployer.java:80)
                        at com.vmware.vise.extensionfw.ExtensionManager.addPluginPackages(ExtensionManager.java:319)
                        at com.vmware.vise.extensionfw.impl.ExtensionServiceImpl.addPluginPackages(ExtensionServiceImpl.java:122)
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:597)
                        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
                        at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
                        at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
                        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
                        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
                        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                        at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
                        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
                        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
                        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                        at $Proxy252.addPluginPackages(Unknown Source)
                        at com.vmware.vise.vim.extension.VcScriptPluginManager.addPackages(VcScriptPluginManager.java:374)
                        at com.vmware.vise.vim.extension.VcScriptPluginManager.sessionStarted(VcScriptPluginManager.java:168)
                        at com.vmware.vise.security.DefaultAuthenticationProvider$1.call(DefaultAuthenticationProvider.java:399)
                        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                        at java.lang.Thread.run(Thread.java:662)
                        Caused by: org.xml.sax.SAXParseException: The element type "extension" must be terminated by the matching end-tag "</extension>".
                        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
                        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
                        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
                        at com.vmware.vise.extensionfw.impl.PluginManifestParser.getPluginManifest(PluginManifestParser.java:57)
                        ... 33 common frames omitted

                         

                        The configuration xml looks fine:

                         

                        <scriptConfiguration  version="1.0.0">

                          <key>key</key>
                          <description>desc</description>
                             <extension parent="Inventory.Cluster">
                          <title locale="en">PluginLabel</title>
                        </extension>
                        <extension parent="Inventory.HostSystem">
                              <title locale="en">PluginLabel</title>
                               <url>https://IP:9443/vsphere/loadclient</url>
                        </extension>
                        </scriptConfiguration>

                        I loaded the url in a browser and cross verified that the xml is well formed and there were no errors.

                        For the same error probably, the plugin stopped showing up in the stand alone vSphere client too with the use of "extension" !!!

                        Thats the reason we moved back to using the "view".

                        • 9. Re: Legacy Script Plugins in Web Client
                          laurentsd Master
                          VMware Employees

                          The parser doesn't lie  :-)  so there is something incorrect in the XML it is receiving.  It could be the cached version of scriptConfig.xml that was downloaded with your script plugin somewhere in %PROGRAMDATA%/VMware/vSphere Web Client/vc-packages/

                          I would erase that cache and try again.

                           

                          What version of the C# client are you using to test your script plugin?

                          • 10. Re: Legacy Script Plugins in Web Client
                            ravirangappa Novice

                            Well, we have some leads now!!!

                            The web client seems to be auto-generating the web client plugin format from the script plugin configuration.

                            I see the generated package under C:\ProgramData\VMware\vSphere Web Client\script-plugin-packages\com.vmware.vim.viClientScripts\com.abc.product.RRhb-1.0.0.

                             

                            Observations:

                            1. The generated XML is malformed. I dont see the extension close tag getting generated. This explains the virgo error log.

                            2. $extendedPoint seems to be a variable which should probably have been replaced with Inventory.HostSytem and Inventory.Cluster. Is this replaced runtime with the selected object?

                             

                            <?xml version='1.0'?>
                            <plugin id='com.abc.product.RRhb'>
                                <extension id='com.abc.product.RRhb.1.0'>
                                    <extendedPoint>$extensionPoint</extendedPoint>
                                    <object>
                                        <name>RR Product</name>
                                        <componentClass className='com.vmware.vsphere.client.views.WebPluginView'>
                                            <object>
                                                <root>
                                                    <useContextObject>true</useContextObject>
                                                    <scriptUrl>https://ip:9443/vsphere/loadclient</scriptUrl>
                                                    <extensionId>com.abc.product.RRhb.1.0</extensionId>
                                                </root>
                                            </object>
                                        </componentClass>
                                    </object>
                                    <metadata>
                                    </metadata>
                                    <extension id='com.abc.product.RRhb.2.0'>
                                        <extendedPoint>$extensionPoint</extendedPoint>
                                        <object>
                                            <name>RR Product</name>
                                            <componentClass className='com.vmware.vsphere.client.views.WebPluginView'>
                                                <object>
                                                    <root>
                                                        <useContextObject>true</useContextObject>
                                                        <scriptUrl>https://ip:9443/vsphere/loadclient</scriptUrl>
                                                        <extensionId>com.abc.product.RRhb.2.0</extensionId>
                                                    </root>
                                                </object>
                                            </componentClass>
                                        </object>
                                        <metadata>
                                        </metadata>
                                    </plugin>

                             

                            I tried modifying the xml into a well formed document. But the xml gets regenerated every time I login into the web client and goes back to the same state

                             

                            I am using vSphere Client 5.1 by the way:

                            vc-ver.JPG

                            • 11. Re: Legacy Script Plugins in Web Client
                              laurentsd Master
                              VMware Employees

                              Yes, the orignal scriptConfig.xml is transformed into a web client compatible plugin.xml that is cached at that location.

                              To further understand why it doesn't work in your case I would need to get the full scriptConfig.xml, you can send it to me a private email. Thanks.

                              • 12. Re: Legacy Script Plugins in Web Client
                                laurentsd Master
                                VMware Employees

                                OK, something else obvious that escaped me earlier:  you are not using the right syntax in scriptConfig.xml for inventory views.  It should be

                                <extension parent="InventoryView.Cluster">

                                and not

                                <extension parent="Inventory.Cluster">

                                 

                                The only supported script plugins are the ones following this spec https://www.vmware.com/support/developer/vc-sdk/vcplugin/vSphere_Plugin_4_1_Technote.pdf

                                • 13. Re: Legacy Script Plugins in Web Client
                                  ravirangappa Novice

                                  Yes!!! That was it !!!

                                  I have verified that the plugin now shows in both c# client and in the web client.

                                  Thank you so much for your help.