VMware Communities > Blogs > Developer Center Blog > Tags

Blog Posts

Developer Center Blog

6 Posts tagged with the sdk 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

This week VMware announces the latest Software Development Kit and I had a chance to catch up with Hari Krishnan the VMware Infrastructure Product Manager for the VDDK.

Pablo: Please tell us about your professional background?
Hari: My professional background includes over 10 years of varied experience in product management, product marketing and technology development for software, security and networking products. Before joining VMware, I was a product manager at F5 Networks for SSL VPN product line. Prior to that I co-founded a start-up ISPsoft, Inc. where I managed IP service provisioning software product. Earlier in my career, I worked in Bell Labs (Lucent) where I developed technologies for IP network management. I got my MS degree in Computer Science from University of California at Los Angeles (UCLA) and Bachelor of Technology degree from Indian Institute of Technology (IIT), Chennai. On the personal side I enjoy the great outdoors and thought it would be nice to have an image of my favorite vacation spots; Yosemite National Park. yosemite.jpg

Pablo: You must be excited about releasing the VMware Virtual Disk Development Kit, can you tell us why our developers should be interested in it?
Hari: Yes. With VMware Virtual Disk Development Kit we are enabling a new eco-system of partners to develop solutions that integrate with VMware virtual disk. The VDDK is an open SDK that developers can use to build cutting edge applications for creating and accessing VMware virtual disk storage.

Pablo: What are some of the use cases for using the VMware Virtual Disk Development Kit?
Hari: Virtual Disk Development Kit provides easy access to VMware virtual disk storage.

This enables a wide range of use-cases for application vendors including:
o Creation of virtual machine disk files to store backup of physical images
o Read access to virtual disk to enable off-line centralized scanning of virtual machines for anti-virus
o Write access to virtual disk to enable off-line centralized patching of virtual machines Read access to virtual disk
to enable off-line software package analysis of virtual machines

Pablo: Can you tell us how the VDDK compare contrast to our other SDKs ?
Hari: Sure. It’s important to understand the focus of various VMware APIs and SDKs when developing a solution that supports VMware virtual infrastructure. VMware Developer Center is a good place to start.

In particular, if you are developing a backup solution it is important to understand how VDDK compares with VCB (VMware Consolidated Backup) and VI API. VI API is a Web Service / XML interface focused on management of virtual machines and ESX host configuration. Virtual Consolidated Backup enables LAN free backup of virtual machines from a centralized proxy server and eliminates backup traffic from your LAN to improve performance of production virtual machines. VDDK is focused on efficient access and transfer of data on virtual disk storage. VDDK can be used in conjunction with other APIs to offer a complete integrated solution for management of virtual infrastructure. For example, you can use VI API to discover virtual machines deployed on ESX. VDDK can be used to read or write information onto virtual disk associated with a virtual machine. Backup vendors can augment VCB with VDDK to tightly integrate with VMware virtual disk storage.

Pablo: What is the relationship between Open Virtualization Format (OVF) and the VDDK?
Hari: Open Virtualization Format (OVF) is an open, industry standard for packaging and distributing virtual machines. OVF can be used to encapsulate meta-data about a virtual machine such as virtual hardware requirements, licensing information, virtual disk information and product information for virtual appliance. OVF is extensible so virtual appliance vendors can also embed additional meta-data about their product in OVF. OVF supports multiple virtual disk formats including VMware’s VMDK format as well as Microsoft’s VHD format. OVF simplifies deployment of virtual machines by offering a standard way to package and distribute virtual appliances for multiple hypervisor platforms.

VDDK is an open API and SDK to create and access information on VMware virtual disk storage (VMDK). Future versions of VDDK will include support for creating and accessing virtual disks packaged in OVF format.

Pablo: What should our developers do?
Hari: I would encourage developers to check out the VMware developer center, download the VDDK, get involved in VMware developer community, ask questions as well as give us your feedback.
For Download http://vmware.com/go/virtualdisksdk . Bookmark link to VDDK Forum VDDK forums

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
0


For folks that might have recieved errors when replacing a VMDK with another VMDK file using FileOperation this Knowledge Base Article was just published, hope its helpful. KB ID 1003567

0 Comments Permalink
2

Welcome to the VMware Developer Center Blog
elsalvi.jpg

Atami Beach, San Salvador

Hello,

Welcome the VMware Developer Center Blog. My name is Pablo Roesch and I am the Product Marketing Manager for the VMware Infrastructure SDKs. My job at VMware is to help empower developers, IT administrators when integrating, and automating with our SDKs.

Before VMware I worked for Sun Microsystems in various roles, most recently responsible for building out the Developer Services Portfolio for the Sun Developer Network. On the personal side I have lived in San Francisco most of my life, and enjoy spending time with my wife and kids. Just in case you are ever in this fine city I would recommend the Slanted Door for dinner and CafeGreco for an after dinner Cappuccino. As a side note I have included a photo of my all time favorite beach in San Salvador which helps me put things into perspective.

It is an exciting time for us at VMware as our SDKs are going through a much needed evolution with recent release of the VI Perl Toolkit 1.5 and upcoming sneak peak of the VI Toolkit for Windows (manage VI using Powershell)

I often get asked what the difference is between the VMware Developer Center and the Developer Community so thought I would bring this up front.

The VMware Developer Center provides information on latest SDK product downloads, knowledge base articles, webinars, questions and answers as expressed by VMware. The Developer Community is how the community interacts with VMware. The VMware Community is where developers, scripters post questions about our SDKs, provide sample code for community use, and comments on our products.

Visit our VMware Developer Center http://vmware.com/developer as we have recently made some much needed improvements to hope you find them helpful.

Navigation: Created a new navigational bar on right hand side, which will help with navigation of our site.

Knowledge Base Articles: Growing list of KB articles, to see current list click here

SDK Questions and Answers: Adding list of frequently asked questions

New webinars and sessions: New sessions posted range Product information to VMworld Sessions.

VMware Sample Code: Ongoing effort to increase our code sample library as requested by our users. Comment or suggestion for Sample Code? Please let us know by answering this quick questionnaire.

We look forward to continuing improvements to our site, please keep the feedback coming !

Pablo Roesch - VMware SDK Product Marketing Manager

Visit the VMware Developer Center: http://vmware.com/developer Latest Downloads, Code Samples, Knowledge Base Articles

2 Comments Permalink