VMware
14 Replies Last post: Mar 25, 2008 5:55 AM by akutz  

How to create a VI 2.5 client plugin posted: Feb 15, 2008 6:08 AM

Click to view akutz's profile Hot Shot vExpert 323 posts since
Nov 9, 2005
This is not a replacement for the white paper I am writing that describes VI client plugin development. Consider this a "BSG: Razor" tactic. Yes, the real product is coming, this is just to tide you over :)

To create a VI client plugin you just need to build a .NET library assembly (as opposed to an EXE). Your assembly should reference the following VMware assemblies (by default found in "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\2.5\")

  • TransportInterfaces.25.dll
  • VimSoapService.25.dll
  • VimSoapService.25.XmlSerializers.dll
  • *VIPlugins.dll
  • VirtualInfrastructure.25.dll
  • VpxClient.SSPI.dll

VIPlugins.dll is the only assembly required, but the plugin you are creating would be pretty bland if you did not reference the rest of the above assemblies.

Your assembly should have at least one class that implements the following interface defined in VIPlugins.dll: VMware.VIClient.Plugins.Plugin. Implementing that interface requires your class to implement the following methods:

  • void Load( VMware.VIClient.Plugins.VIApp viApp )
  • void Unload()

You could go ahead and compile your assembly, place it and its dependencies in a directory under (by default) "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Plugins\" and it will show up in the VI client plugin manager.

You may be asking yourself, is that it? Hardly. However, the rest of the explanation is at this time best left to code comments. Please visit http://www.lostcreations.com/code/browser/trunk/vmware/viplugins/SVMotion/SVMotion/SVMotionPlugin.cs to see a syntax-colored view of the SVMotion plugin. The code is thoroughly documented and should tell you everything you need to know to write a basic VI client plugin.

Hope this helps!

Re: How to create a VI 2.5 client plugin

1. Feb 16, 2008 1:03 PM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Yes it helped ;-) Thanks a lot, thanks for your investigation - great work. I converted my app within minutes to work as a VC plugin.

Of course it was just a question of time that this would happen. With Java and .NET reverse-engineering is not longer that hard as it was earlier, and it really suprises me that VMware has not published a whitepaper on it's own. But surely they will/have to in the near future.

Keep up the good work!

Thx, Tos2k

Re: How to create a VI 2.5 client plugin

3. Feb 16, 2008 1:14 PM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Hehe, I just thought about this when writing, but I think you got the meaning 100% right ;-)

Thanks for the great work, I'am looking forward to more, and as offered before, let me know when there is something to participate in/with

=)

Tos2k

Re: How to create a VI 2.5 client plugin

5. Feb 16, 2008 2:15 PM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Good idea! I will keep you updated, especially when the plugin version (really) reaches it final state...

Tos2k

Re: How to create a VI 2.5 client plugin

7. Feb 18, 2008 1:25 AM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Hi!

Actually I did not read your comments in detail. I wanted to convert my project as fast as possible, so what I did was to extract the real lines of code (sorry to say, which means to delete all the comments) and adjust them to fill my needs.

Next time when I will start to use all the plugin functions provided I will read more deeply, but maybe you provide the whitepaper before?

Actually I read you post in this forum, and that was all I needed to get it working.

Tos2k

Re: How to create a VI 2.5 client plugin

8. Feb 18, 2008 12:59 PM in response to: akutz
Click to view INSYSTEK's profile Novice 24 posts since
Jun 6, 2006

Very nice!

I noticed that the views are related to the app views (inventory,datastore,etc), not the tab view on the right pane of the VI3 client.

Any direction on how to add tabs to specific managed objects then navigate to that tab from the menu?


Re: How to create a VI 2.5 client plugin

11. Mar 25, 2008 2:08 AM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Hi!

I have a couple of questions concerning your VIplugin guide:

1) How can i add views to the inventory (which be default shows 4 elements plus a checkbox) ?

2) Is it possible to enable drag&drop (f.e. of VMs, Datacenters,Hosts aso.) to a plugin ?

3) Is it possible to (directly) access the inventory items (VMs, hosts, datastores, virtual disks, pools...) which VC provides from a plugin? How?

Tos2k

Re: How to create a VI 2.5 client plugin

13. Mar 25, 2008 5:15 AM in response to: akutz
Click to view tos2k's profile Expert 323 posts since
May 11, 2007

Hi!

Thanks for your reply.

1) yes. How do I reach this control?

2) I added a dragdrop eventhandler to my plugin-form, but it seems that draging of VMs is not enabled to the plugin. U got any idea on how to enable this?

3) So the current state on this is the each plugin has to maintain its own VC inventory? Sounds a little rare, as the plugin is running in VC

I know that the plugin stuff is not official from VMware, so here we may have reached one of the reasons for doing so ;-)

Tos2k

Developer Social Media

Communities