VB programmers are SDK programmers too
Richard Garsthagen has been burning the midnight oil to hook the VI3 SDK to Visual Basic using web services:
Well I am finding out more and more that the VirtualCenter client is by far not using all the actual functionality of the VI3 product. One of the things the SDK does expose is for every physical server what kind of CPU it has and what features are available. You can even compare if one physical server might have different cpus. So, yes I could write a very easy application in Perl (using the perl toolkit) that shows you all the servers and their cpu features, high light the differences and asking you if you want to set a specific cpu feature mask for a group of selected virtual machines. All automated. Writing that application should take me about one hour. But then all you people need to be able to run that application, meaning you need to have perl installed, add some extra needed modules to perl, download the VI perl toolkit, compile the toolkit and run my small perl app. ...
til now!!!!!!!!!!!!!!!!!!!!!!!!!
Yippie, I can not express how happy I am. For 3 nights in a row I have been limiting my sleeping time on trying this challange. But I have done it. I have a working VB application running, where I actually understand the source code and wrote every single line of it myself, I have no slow delay problems (as many other people have using the WSDL file). WOW! Why did no one do this before??
Update: If you're a Perl monger, Richard has also written about the VI3 Perl Toolkit as well.
I have created a PDF document with a description of how to build your own VMware SDK Visual Basic Application. I noticed that a lot of people are having problems with the SOAP connection to de VirtualCenter server so that why I created the template. Maybe you can spread the word. The article can be found on http://www.ntpro.nl/blog
Regards,
Eric Sloof
Eric Sloof is a VMware Certified Instructor based in the Netherlands, he is working as an IT specialist for over 15 years and is running the www.ntpro.nl website.
I am a huge fan of the website run-virtual.com, on November the 16th 2006 Richard Garthagen yelled Yippie!! in one of his posts and that was for a reason. Richard was able to talk to VirtualCenter via SOAP with his own Visual Basic application. On November the 21th he published his first application with the name VmotionInfo. That was the eye opener for me. I immediately visited the vmware.com website to get my hands on as much SDK info as possible. Unfortunately the VB example folder was empty. During the next months I was struggling with C# and Googeling like crazy but my VB application could not communicate with VirtualCenter. In the beginning of April 2007 I attended the TSX in Nice and got up early to visit the VI3 Perl SDK lab hosted by Jeremy van Doorn. Afterwards I interviewed Jeremy and asked him if VMware is going to release the SDK examples for Visual Basic. His answer was that it will be released this year ? This year I thought. I want to start writing my apps write know. This week I had a breakthrough, only slept for a few ours last night but it paid off. My Visual Basic application is communicating with Virtual Center and “logging on” takes an eye blink. Yippie!!! I only have till Friday to work on my first app because after next weekend I am delivering the VI3 Install and Configure training in The Hague and Eindhoven so I decided that I am going to share my invention. I am going to write a complete “how to” and will publish all the source code and VB project files on my website www.ntpro.nl. Stay tuned.
Posted by: Eric Sloof | April 24, 2007 at 05:43 AM
This week I overwhelmed Robert Baumstark with a lot of questions regarding his ViClient.dll. I started with downloading the pre build dll files from Rob’s website and added them as a reference to my Visual Basic application. So far so good, then I pasted the code from Rob under a button and there was trouble in paradise. Rob warned that this code was written into an e-mail without testing and compiling so it could contain some typo’s and I did. Rob gave me a lot of good tips and hints and after a few hours of struggling there began to shine some light at the horizon. The hardest part of writing your own VMware VB application is to understand how the object references can address an object within your VI-3 environment . I took me some time to get a good grip on that subject. When you finally have all the pieces together you can start programming . I created a little demo witch query’s the VI-3 environment for information about Virtual Machines. Especially the number of CPU’s but my final goal is to query the VM’s that won’t start automatically when the ESX rebooted. This is the most forgotten setting in the properties of a VM and this topic isn’t covered in the VI3-IC course either. Another function I would like to add to my first application is to query all virtual machines in a DRS cluster for a connection to the CD player. This connection is important when you want to V-Motion a VM to another host. So I am happy to announce that my first handy application has seen the light.
Eric Sloof http://www.ntpro.nl/blog
Posted by: Eric Sloof | May 11, 2007 at 01:04 AM
vmCD Connected ?
When you have created a DRS cluster the virtual machines in this cluster are automatically migrated to the least busy ESX host. These migrations depend on VMotion. The most common show stopper for VMotion is a connected CD. This application checks if one of your virtual machines is connected to a CD and displays witch ISO image is connected. I’ve written this application in VB.net and it depends on the VIClient.dll witch is written by Robert Baumstark. Some features like disconnecting all the CD’s with one click of a button isn’t implemented yet, but I’m so proud of my first application that I published it on my weblog anyway . If you want to give it a try, you can get a free copy here.
Eric Sloof http://www.ntpro.nl/blog
Posted by: Eric Sloof | May 16, 2007 at 05:33 AM