VMware Communities > Blogs > Developer Center Blog > Tags

Blog Posts

Developer Center Blog

5 Posts tagged with the vi tag
0

I presented the Java API for VI SDK at VMware Technology Exchange in San Jose yesterday and got very positive feedbacks.

Here are two UML diagrams I used in my presentation. I think they are very helpful to understand the API and the design thoughts behind it.

1. The overall object model

overall.JPG


It can be inferred from our VI SDK API reference. Please note that we don't have a managed object type called ManagedObject in our reference. This is a type defined to capture all the common properties and behaviors of all managed objects. Given the limited size, I only show the names of the types, not properties and methods.

To better group these managed object types, I used 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, for example getAuthorizationManager().

In the middle of left side, you can find ManagedEntity class and its sub-classes like HostSystem, VirtualMachine. These classes represent all the items you could find in the inventory tree from VI client. 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. For this reason, both HostSystem and all the attached classes are tagged the same color.

2. A detailed partial UML diagram

detail.JPG

This UML diagram is extracted from the overall model but adds much more details with properties and methods. If you can understand this diagram, you can then easily understand all the other managed object types.

The ManagedObject class holds three properties:

1. mor of type ManagedObjectReference -- pointing to the ManagedObjectReference object that is used to represent a managed object in VI SDK.

2. serverConnection of type ServerConnection -- pointing to the ServerConnection object I will cover later.

3. objectContent of type ObjectContent -- used for local caching for better performance.

Besides accessors, the class has getCurrentProperty() method defined to encapsulate the PropertyCollector. This method gets called in subclasses to get a property. For example, the getName() in ManagedEntity called it like (String) getCurrentProperty("name"); In most of cases, you don't need to use it at all, I already provide explicit getter methods in concrete subclasses. I may change its visibility to protected later. The other two methods, "getCachedProperty() and refreshPropertyCache()" are designed for caching.

The ServerConnection is used to represent a connection to the server under a specific login user. It holds information like url to the server, the userSession with username etc., and vimService which is the JUMBO interfaces with 300+ methods. For convenience, ServerConnection also has a reference to a ServiceInstance object.

Now let us take a look at the ServiceInstance type. It's a special managed object and the first managed object you will have in a typical application logic flow. You can create a new ServiceInstance object by providing url/username/password, or url/sessionID combination. The later is not used as much as the first constructor, but very helpful when you develop a VI client plugin in Java. I will talk more about it later blogs.

According to the API reference, the ServiceInstance has a ServiceContent object, which holds all the ManagedObjectReferences to various "manager" attached to it, and an AboutInfo object. You can get any of them in a single call. ServiceContent object is, therefore, no long needed, and I don't even provide a getter to it.

The right side of the diagram are the ExtensibleManagedObject and its subclass ManagedEnity. E.M.O doesn't have methods defined at all, but three properties. Therefore it only has three corresponding getters.

ManagedEntity is one of the most important class given that VirtualMachine, HostSystem etc. are all inherited from it. Besides accessors and several methods, I provides some methods to retrieve items in the inventory tree. For example, you can easily find all the Virtual in one single call. Property is used within these methods, but you don't see it.

The above two ML diagrams should have given you a big picture about the object model and how key types are related to each other. If you really need to know more details. Please click into my May 8 posting and read the source code there. For sure, it will give you much more details than I can cover in these two ML diagrams.

0 Comments Permalink
1

The open source client side Java API for VI can now be found at

http://sourceforge.net/projects/vijava

Thanks!

1 Comments Permalink
0

Folks,

Just wanted to let you know that we have just published a document to help you get started when using the VI Toolkit for Windows.

Document Title: Managing VMware with PowerShell - Frequently Asked Questions.

Document contains frequently asked questions and code samples to help you get going.

A big thank you to the Product Management, Developer Support Engineering and R&D teams who contributed to document. We hope the document is useful, and please feel to comment so we can improve our products.

Link: http://communities.vmware.com/docs/DOC-4210

Regards,

Pablo

0 Comments Permalink
0

The VMware Technology Exchange Event..

I have been recently involved with helping put together the VMware Technology Exchange event and wanted to share some insight on what the event is about and why an ISV / IHV might be interested in attending..

Event goals: The goal of the VMware Technology Exchange event is to get our partners and product teams together to share product directions, understand integration points, and learn how VMware can help you go to market with your solution.

About the sessions: We are planning on 70% percent deep technical content and 30% business topics making this ideal for Product Managers, Software Developers, Development Managers and Business types. If I were to recommend sessions for folks out there interested in VI integration I would suggest Power Shell for Partners, VI Performance Monitoring and the VC Client Plug-ins. I tend to lean in favor of the VI oriented sessions but there are plenty of other sessions discussing Security, Storage and Applications.

Who can attend ? We are limiting this to our Technical Alliance Partners (TAP) members so if you are not a TAP member you might be interested in joining the program... For folks on a budget the Access level is no charge and you can apply at: http://www.vmware.com/partners/alliances/programs/

Please note there is a Event Fee of $725 and it also includes a 1 year license for VMware Infrastructure and VMware Workstation.

So if we see you there be sure to say hello, and if we meet during the reception I would be more than happy to purchase you a refreshment of your choice.

Regards,
Pablo Roesch
SDK Product Marketing Manager

Event Details:

When: May 13, 14, 2008 San Jose Convention Center, CA

Registration Website, more information: http://vmwaretechnologyexchange.com

0 Comments Permalink
0

VMware Developer Center Blog - Developer Spotlight April 4th, 2008

andrew_2.jpg

I had an opportunity to meet with Andrew Kutz and wanted to share this conversation with folks out there that might be curious on who the person is behind the great contributions he has provided to the VMware Developer Community.

Andrew: First of all, thank you for this honor. The VMware online communities are for me the most professional and helpful forums I have ever had the opportunity to be a part of, and to be singled out amongst the long list of brilliant participants is an experience I will not soon forget.

Pablo: Tell us about your programming background and work experience?

Andrew: Short Version : I'm a geek whose had the privilege of working in a variety of odd jobs (from a boat valet to a Senate Paige) and Programming languages (from C to C#) for the last decade, transforming me into somewhat of a mutt, just like my baby boy Scruffy who is pictured with me above. I guess I fit the old cliche, "Jack of all trades ...". I don't really qualify for the "wearer of many hats"description since those who have met me know that I pretty much only wear my gray fedora, and that's it : )

Long Version: A lot of people are a bit taken a back by my area of study in college -- my degree is in Ancient History and Classic Civilization, so I do not have the same structured background as a lot of the developers you may meet. While some individuals look at my resume and deduct a point from their opinion of me, I've never looked at my chosen educational path as a negative, rather I think it taught me a whole separate area of critical thinking that a lot of programmers are missing these days. Truth be told my intent was to pursue a career in law, but I married soon after graduating college and my number one priority became helping my Mandy finish her graduate career in the history department at the University of Texas at Austin (UT).

Despite my penchant to disappear at parties only to be found upstairs participating in a mad orgy of Latin and Greek oration, I have actually been hacking out code since the days of Q-Basic and Nibbles.I suppose my professional programming career began when I worked at the American Crane & Equipment Cooperation (ACECO) and then went into hibernation once I began attending college where I worked several very non- technical jobs (albeit still geeky): a music geek at Tower Records on the Drag, a political geek as a paige at the State of Texas Senate, and even a car and boat geek as a valet for a lake-side restaurant. Eventually I ended up working for the UT Academic Computing and Instructional Technology Services (ACITS) Help-desk. From the help- desk I moved to the NT group that became the Windows Enterprise Services (WES) group. I stayed put for another 7 years in which time I cranked out a bunch of random code that somehow managed to function as Sudo for Windows (Sudowin), Exchange resource schedulers,Mainframe-to- Active Directory account synchronization web services, and they even let me manage a few servers(Terminal, Web)!I also helped create the first central-IT virtualization solution at UT using VMware ESX 2 and VirtualCenter. Just as the virtual infrastructure was getting off the ground I did something silly and left UT to pursue an Analyst position with the Burton Group. After 6 months I learned that the life of the analyst was not for me (too hands off), and I returned to UT as a member of the Information Technology Services (ITS) Applications group where I am currently abusing my on-the-clock time to respond to these questions! : )

Oh yeah, just because my editors would be a little peeved if I didn't mention it, I also write for SearchServerVirtualization, SearchVMware, andSearchEnterpriseLinux.TechTarget.com. So, you know, check them out! : )

Pablo: Tell us about any recent or cool projects you are working with using the VMware SDKs ?

Andrew: (All code mentioned is freely available under the New BSD license)Sure thing! FYI - all of the current VMware-related code I am working on is FREELY available or linked from http://www.lostcreations.com/code/wiki/vmware/

. Definitely one of the cooler things I am working on is Monét.Monét exports VI logs to a syslog or Windows event log server. I wrote it in part to help other developers understand basic ideas about VI SDK development, and since it is implemented in C#, Java, and Perl, it is a great way to see how to transition between the different languages
that are available to leverage the VI SDK. About a month ago I managed to get lucky with Lutz's Reflector and figured out how the internal plugin architecture of the VI client is
put together and released the SVMotion plugin. Since then I released a PDF that explains the VI plugin architecture and hopefully shows other developers how to create plugins (I apologize if it doesn't make sense, I wrote most of it while trying to keep track of the
goings-on of 4 dachshunds). In an effort to recapture some hosting costs I started VIPlugins.com for the sole purpose of injecting some Google ad placements (j/k). So far I've had +12,000 downloads of the PDF and various plugins and no click-throughs -- sigh. Two of the cooler plugins are Invoke, which lets you invoke third-party applications from within the VI client using the currently authenticated session cookie and 37migrations. The 37migrations plugin works in conjunction with 37migrations.com to plot VMotion events across the world.Basically I was looking for an excuse to play with the Google Maps APIs : )

I also started work on ivi - the Java Virtual Interface (sorry, that's my Latin showing --J's looked like I's back in the day -- wayyy back).ivi is an attempt at creating an OS-agnostic management application for VMware VI, Xen, KVM, and OpenVZ. ivi attaches to the aforementioned virtualization solutions using the VI SDK, the XenAPI, and lib-virt. So far ivi can connect to VI and Xen and list their contents. Once I get lib-virt to compile and function (the latter is the hard part) on my Mac I will include support for KVM and OpenVZ. I know the project is in alpha stage, and while the milestone of listing contents seems simple, the project is more about creating an abstract plugin architecture for accessing multiple virtualization solutions than actually producing a marketable product. Again, the code for ivi is OPEN and FREE.

Some ideas swirling around in the mess that is my mind include:

- - Implementing the Cisco IOS commands for the ESX virtual switch infrastructure using Perl? Maybe? Dunno yet...

- - A free and open implementation of VirtualCenter called OpenVirtualizationManager in order to help reduce the cost of a VMware Infrastructure.

- - A role-playing game at VMWarpg.com that uses stats from your VI installations to generate stats for your avatars, and you battle for territory on Google maps. Think D&D meets Risk.

- - A version of the VI client written with the Google Web Toolkit called Aianteia (cooming soon).

Some people may ask, "Aren't you worried about showing your hand?" Not really, if you want to take any of these ideas and run with them, please do so. I just ask that if you need help that you ask me as I'd love to be involved. I'm just in it for the fun. It was for the groupies, but turns out that virtualization groupies, yeah, not so much. : )

Pablo: How long have you been using the VMware SDKs and what has been your experience using them ?

Andrew: I have been using the VMware SDKs since the summer of 2006 when I started playing around with the VI SDK in order to automate the creation of port groups. I parlayed that experience into a series of articles forSearchServerVirtualization.TechTarget.com called "Leveraging the VI SDK with .NET" that have apparently remained high- traffic articles to this day (It's got to be because of spiders, certainly not readers!) : ) Anyway, I've been hooked for developing for VMware and other virtualization solutions ever since.

Pablo: What would you like to see from VMware in terms of SDK / API functionality ?

Andrew: I would LOVE to see the equivalent of the VI Perl Toolkit for C# and Java. I now understand that the odd nature of the SDK (a reference for one and all!) is simply due to the nature of SOAP, but it does not make it any less aggravating to deal with. I have played with the C# toolkit that VMware uses internally and it is sooo smooth. Smooth like a line of Aaron Sorkin's dialogue smooth. We're talking triple-blade action smooth. You get the idea.

I would also like to see a unified SDK. In terms of Java:

com.vmware.vim
com.vmware.workstation
com.vmware.fusion
com.vmware.server

And the all important:

com.vmware.common
com.vmware.virtualmachine

The last one would be really nice in order to tie together common VM properties and such. Of course, this would have to be a public- facing SDK that VMware wasn't married to for revision purposes, but it would still be nice from a developer point-of-view to have
VM-management code work regardless of the intended product or platform. Of course, this is probably made difficult by the generational differences between all of VMware's products, but a boy can dream, no?

Pablo: Any tips for developers out there new to the VMware SDKs ?

Andrew: Certainly they should use the VMware Developer's Center! Us "old- timers" did not have access to such a luxury back in the "day" (umm, last year!), so anyone new to VMware development should certainly take advantage of VMware's new commitment to its development communities.Also, you can always e-mail me. I'm always happy to help out when I can.

In a previous Spotlight, Tom Milner related some sage advice that I would like to repeat -- "What do you want to do with it?" Tom, I could not agree more. Too many developers see a problem and create a solution. That works, but you usually end up with a fairly boring solution. I like to throw caution to the wind and come up with the idea of a solution, and then build the pieces that it takes to get there. At Austin's SXSW festival this year, Apple engineer Michael Loop shared with audience members Apple's design process(http://www.businessweek.com/the_thread/techbeat/archives/2008/03/apples_desi gn_p.html?campaign_id=rss_blog_techbeat). Basically, Apple approaches its design process much like a car designer or a fashion mogul - they design the fantastic and then look for the kernel of truth in their design and work backwards in order to turn truth into reality.

VMware developers should seek the truth in order to create solutions that are beautiful, fun, and fantastic.

0 Comments Permalink