VMware

VITree - Display vCenter like Datacenter/folder tree and search all VMs in a folder

VERSION 3 Published

Created on: Oct 13, 2009 11:55 AM by cpope - Last Modified:  Oct 13, 2009 1:56 PM by cpope

The attached Visual Basic 2008 solution is an example of how to use RetrieveProperties to p ull information from vCenter and populate a treeview with the results. Once populated, you can click on any folder and have the VMs in that folder populated into a grid with boottime displayed.

This project includes a VI.vb module that can easily be reused in other projects. It also includes partially optimized VimApi DLL files and a login form.

Known Issues:

  • If more than one Datacenter is present in vCenter, it will throw an exception that is trapped and continue working with only the single datacenter displayed.

  • If you click on anything other than a folder (datacenter for example) it will throw an error and not display the VMs

Screenshot of the populated project below:


http://communities.vmware.com/servlet/JiveServlet/downloadImage/7295/VITree.PNG

If you want to turn it back on so that it shows VMs in the tree, you will need to:

  • Uncomment Lines 188-191 in VI.vb (Create VM Property Spec)
  • Uncomment Line 211 (setting propSet that includes the VMpSpec)
  • Comment out Line 212 (setting propSet that Does NOT include the VMpSpec)

Attachments:
Average User Rating
(1 rating)




Comments

There are no comments on this document

 

More by cpope

Developer Social Media

Communities