V1.0.0 of sfvAlarms has hit the decks and is now available on the download page. This simple utility allows the export and import of vCenter Server alarms from a simple Windows GUI. It uses the VMware Web Services SDK and is written in C#.
I felt something a lot simpler than having to use Powershell scripting or other scripts would enable managing alarms across vCenter’s to be much more controlled. Being able to import and export alarms at will allows for duplication of alarms as well as being able to revert to a known state in case of meddlers!
All comments greatly received as well as enhancement requests! I have tested as much as I can on vCenter 4 and against the vCenter 5 appliance. The User Guide on the download page has much more info about the utility.
If you are giving it a whirl I would obviously suggest not installing it on a production environment, but trying it out on a test vCenter installation first or maybe the VMware vCenter 5 appliance that can be downloaded from VMware.
Hope it proves useful, if not at least it has been a technical exercise for me to brush up on some programming skills 🙂
As per the developer setup guide for VMware vSphere Web Services SDK 5.0, you have to build your own DLLs from the wsdl files provided.
There are a few changes from SDK 4.0, most notably the lack of the genvimstubs.cmd and OptimiseWsStubs.exe files. However it is still fairly straightforward… apart from the initial wsdl command! read on…
Depending on where you extract the SDK zip file to you may end up with spaces in your path. After lots of head scratching it turns out wsdl.exe does not like this! If you have spaces in your path, then when running command “wsdl.exe /n:VimyyApi vim.wsdl vimService.wsdl” you will get an error as follows – despite trying all combinations of environment variables, running from Visual Studio command prompt in the actual vim25 directory:
Error: Could not find a part of the path ‘c:\program%20files\microsoft%20visual%20studio%209.0\sdk\vsphere5\vsphere-ws\wsdl\vim25\query-messagetypes.xsd’.
So rather than copy to e.g. Visual Studio/SDK path, just extract to e.g. C:\vSphere5\… and then once produced the two DLLs if you want to compile the samples, then move/copy to correct folder afterwards. The main DLL gets produced twice – the first time ‘as is’ to then produce the second XMLSerialisers DLL, then again when the reference to this DLL has been added to the vimservice.cs file and the XMLAttributes commented out – this is all in the Developer Setup Guide.
Hopefully this will save a few hours as I spent trying to work out what was going on! (This was with VS2008).
Anyone who has custom alarms in vCenter will be frustrated when they need to set up the same alarms in multiple datacenters as there is nothing out of the box that provides this either in vSphere 4 or 5 (please let me know if there is!).
To this end I have written a utility that allows simple export and import of alarms in and out using the C# web services API. It works really well and also effectively allows state management of alarms so that if anyone fiddles with alarms can easily reset to known set.
Update 21st May 2012 – nearly ready to upload… been doing some more coding on the front end over the weekend. Works with vSphere4.. just looking at vSphere5 compatibility.
Just testing out the free HP Touchpad app on WebOS that allows blog posts.
Welcome to the some-time blog of Stripey Fish… just starting out but will post some stuff soon. BTW typing this post using Windows Live Writer.