UI Extensibility of System Center Virtual Machine Manager, Compared with vSphere
To my curiosity, I attended the session “Building UI Add-ins for System Center 2012 SP1 Virtual Machine Manager” by Jonobie Ford, who is the program manager of the add-in SDK. As you may know, I wrote several docs on vSphere Client plug-in and helped many partners to develop their plug-ins during my days at VMware.
It turned out the extensibility story of System Center Virtual Machine Manager (SCVMM) is pretty similar to what vSphere had before. Note that the terminology used in vSphere is plugin instead of add-in in Virtual Machine Manager. They are essentially the same. The new vSphere Web Client has some thing for similar purpose but quite different plug-in architecture.
Time to learn how to "Google" and manage your VMware and clouds in a fast and secureHTML5 App
Two Types of Add-ins: XML and Code
There are two types of add-ins for SCVMM: XML based and code based. The XML based is, as its name suggests, using XML to specify an extension point on the GUI as ribbon icon or context menu with a Web link. Upon clicked, a Web page is opened in a browser. You can think of it as a quick shortcut for convenience. There is no context being passed to the Web server behind the URL as with vSphere Client Plug-in. Because of this limitation, it does not make sense to associate a link with certain entities like hosts, virtual machines, because the server has no way to figure out what the entity is and display customized content.
The code based add-in is much more powerful. You would need to use Visual Studio to write code there – basically fill in the logics into pre-defined interfaces. Microsoft has provided a Visual Studio template that guides you to create a new add-in project. It seems pretty straight forward and easy to follow.
After a new project created, you can implement three types of interfaces:
- add-in lifecycle related, like OnLoad() and OnUnload();
- Action add-ins related, like PerformAction(), CheckIfEnabledFor();
- View add-ins related, like CreateViewControl(), SetCurrentScope(), OnShow(), and OnHide().
The interface names explain all except the SetCurrentScope() which is used to pass on context to your add-in code. With the context object passed in from the SCVMM, you can use PowerShell Cmdlets to get more information about the particular object. As this is called by every switching of selection of your object, you want to keep your code simple and fast so that it won’t slow down the whole SCVMM GUI. If certain add-ins slows things down, they can be disabled.
Going beyond the interfaces to implement, you have other application code to write. For example, if you have complicated views for your GUI, you will have more code or XAML to work on. That is not related to add-in and you can find tons of information from MSDN.
Jonobie did a great job in explaining how the add-in works and how to write one with a quick demo. After the session, I think I can start to write an add-in if I have an environment in front of me now.
Packaging and Installation
Here comes the big difference between vSphere and SCVMM. In vSphere, a plug-in has to be registered via vSphere API. Once registered once, the plug-in is available to every user. With SCVMM, the add-in has to be installed by each SCVMM client (probably per user account). It’s quite easy though – just click on the “Import Console Add-in” and point to the .zip file. Behind the scene, the SCVMM place the directory under a pre-defined directory for it to load each time it starts up. The reason I guess the add-in is per user account is because I saw the user name is actually included as part of that directory path.
Packaging wise, the add-ins are zipped into one single file which includes a mandatory Manifest.xml file and optionally the icon files and related complied code (I assume .dll files).
Compared with VMware vSphere, the vendors who have developed SCVMM add-ins are limited. I heard add-ins for Cisco UCS, HP Virtual Connect, NetApp from the presentation. With the easy-to-use SDK, I assume more vendors will develop add-ins to the SCVMM GUI.
If you are interested to know more, you can check out the presentation with more resources: http://channel9.msdn.com/Events/MMS/2013/IM-B203. The video and slides should be included there free of charge.