Object Model of VMware vSphere API: A Big Picture in 2 Minutes
When I start to use a new API/SDK, I always look for the object model diagram before digging into the API Reference. With that, I can have a good overview of the API, from the concepts to the structure. This can save a lot of time.
Unfortunately, we don’t find such a object model diagram in any official document. The following is the UML diagram from my book VMware VI and vSphere SDK.
The UML diagram can be inferred from VI SDK API Reference. Please note that there is NOT a managed object type called ManagedObject in the API Reference. This is a type I add to make the object model complete. Given the limited size, I only show the names of the types, not properties and methods.
To better group these managed object types, I use different colors. On the right most side of the diagram are the ServiceInstance class and various “manager” classes like AuthorizationManager. From the ServiceInstance, you can get any object of these types with single call in VI Java API, for example getAuthorizationManager().
In the middle of left side, you can find ManagedEntity class and its sub-classes like HostSystem, VirtualMachine. These types represent all the items you could find in the inventory tree from VI Clients. They are the most important managed objects in the whole model, and all tagged with orange color except the HostSystem.
The HostSystem is very much like ServiceInstance in that it has many “System” or “Manager” types closely attached to it, for example, HostDatastoreSystem. You can get hold of these objects with a single method call from a HostSystem object in vSphere(VI) Java API. For this reason, both HostSystem and all the attached classes are tagged the same color.
The diagram shows the object model of VI SDK 2.5. vSphere 4 adds 20+ managed object types. It also changes a few inheritance relationships. Network, for example, becomes a subtype of ManagedEntity in vSphere. Other than these changes, the overall structure and the way how it works are the same.

Good diagram, Steve!
Thanks Dmitri!
More diagrams to come. Please stay tuned.
-Steve
Isn’t this way too complicated for a simple model of Datacenter-Host-VM model ? I found it difficult to understand. IMO It overlays important things with not-so-important ones that makes things difficult.
The vSphere API is indeed complicated, and that is why vCloud API was designed. The vSphere API is like “under the hook” API and the vCloud API is like “driver seat” API. Both are needed depending on what you want to achieve. I think you vCloud API is what you like. I will blog about it later. Please stay tuned.
Hi Steve,
First, thanks for the API !
I don’t really understand how counter works (i already have a look at http://vijava.sf.net/…/samples/perf), do you think you can have a try to make a object model for counter ?
Kind regards,
Damien
Hi Damien,
I am glad you like the API. Have you read the post on performance management in vSphere? http://www.doublecloud.org/2010/03/fundamentals-of-vsphere-performance-management/. Thanks!
-Steve
Hi Steve,
Thanks, i haven’t read this part before (i’m new using the SDK), it’s very intersting.
I think i’ll have to come back to you some times.
Regards,
Damien
Hey Steve,
What is the difference between vim and vim25 ? There some common classes, but not the same behavior.
regards,
Hi Damien,
vim and vim25 are the namespace used to version the VI/vSphere SDK. Before VI SDK 2.5, it was vim; every version after, 2.5. With VI Java API, you only need vim25 package which can handle vim namespace as well.
Steve
Thanks Steve.
I think i was using the wrong sdk till now.. Where could i download last SDK ?
cause i was using this one : http://sourceforge.net/projects/vijava/files/vijava/VI%20Java%20API%202.1/
VI Java API has different versions. The 2.1 you are using is the latest one that support all the VI and vSphere versions. I think you are good.
Steve
Ok. I’ve downloaded and tried the “vijava experimental” from VMware website. What make it “experimental” ? Is it reliable ?
Hi Damien,
As an open source project, VI Java API has never been experimental although we did have one or two experimental features. The one you got from VMware website is totally different thing. For latest vijava API, you can check out http://vijava.sf.net and click the download menu.
Steve
Thnaks Steve, but what would be the difference so ?
Damien, I have not used the other SDK, so I cannot comment on that. However, I know of a research by Andrew Kutz at here: http://vijmark.sourceforge.net/
Steve
Thanks Steve ! That’s really interesting.
Hi Steve. diagram is very much detailed and self explanatory.
Also thanks to Damien and Steve for clearing my vim and vim25 concept.
You are welcome Pranav! Please feel free to join our first community meetup on May 18th. Registration page will be online soon. Stay tuned.