“Last Inch” of Cloud Computing

September 20th, 2010 2 comments

The “last mile” or “last kilometer” is a term in the networking industry describing “the close to end connectivity from a communication service provider to a customer”. Although your infrastructure like backbones is very powerful, your end user experience could suffer if your last mile is not there yet.

For cloud computing, we’ve talked a lot about the data centers, backend servers. What about the end users? Your cloud data center could be very powerful too, but does it mean your users will fully leverage that power? Not necessarily. It depends on how you deliver the service to them.

Because cloud service is delivered with traditional network, the traditional network “last mile” issue is there as well. You surely need a good, if not better, connection to the network.

Beyond the connectivity, you will need good interfaces for your users to interact with the cloud. Let me go over the “last inch” options here.

Google made Instantiations free

September 18th, 2010 No comments

Following my prediction in a previous blog, Google just made the tools from its recently acquired Instantiations free to all developers/testers. Besides goodwills to the developer community, this move makes GWT a serious competitor to Adobe Flex, Microsoft Silverlight for Rich Internet Applications.

You can give these tools a try while developing and testing Web applications, or Java GUI applications:

  • GWT Designer
    “a powerful set of Eclipse-based development tools that enables Java developers to quickly create Ajax web applications using the Google Web Toolkit (GWT).”

Object Model of VMware vCloud API: The Big Picture in 2 Minutes

September 16th, 2010 No comments

VMware released the long-awaited vCloud API at VMworld 2010. The API is based on REST with 75 URLs defined in the user related part as you would find in the vCloud API Specification and vCloud API Programming Guide.

I am an OO guy (I am sure many of you are as well), and find it difficult to go through the 75 URLs and numerous XML tags as either input or return. These URLs are like trees in a forest. But where is the forest?

So I decided to create and show you a UML diagram (shown below) so that you can easily capture the key concepts of the vCloud API. In fact, there was a similar diagram in the programming guide of version 0.8.

Why No DatacenterRemovedEvent? A Deep Dive into vSphere Event Model

September 14th, 2010 13 comments

Last week I discussed how to get event type with vSphere API, followed by a comment asking why there is no DatacenterRemovedEvent? Very good question and almost got me there.

vSphere API has a comprehensive object model for event. In version 4.1, we have 474 different types of events representing different things happened in vSphere. When a managed entity is removed, there are normally events associated, for example, VmDeployedEvent, HostRemovedEvent, ClusterDestroyedEvent, ResourcePoolDestroyedEvent, DatastoreDestroyedEvent, DatastoreRemovedOnHostEvent, etc. It’s natural to expect DatacenterRemovedEvent. But you don’t find one.

It’s not only Datacenter which does have DatacenterCreatedEvent and DatacenterRenamedEvent. For Folder type, you find nothing other than VmBeingClonedNoFolderEvent which is not related to lifecycle of Folder at all.

Why are these events missing?

Categories: vSphere API Tags: ,

How to Avoid Virtual Machine Sprawl in Cloud Age?

September 13th, 2010 2 comments

Technology can be a lot like fashion, with quickly shifting trends. Once we embraced big iron but after the mainframe age the industry went into the client/server age where we soon found too many servers to manage. So we consolidated them, not back to mainframe age, but onto hypervisors. With one physical server, you can run multiple virtual machines.

Server consolidation solved a big problem and resulted in big cost savings. From management’s point of view, however, it does not actually reduce the number of servers to manage in your enterprise. To some extent, it worsens the problem!  In some circumstances it’s so easy and inexpensive to create a new virtual machine that you end up with many more servers than you really want or can effectively manage. This problem not only exists in private clouds, but also in the public cloud.

According to VMware CEO Paul Maritz in his keynote at VMworld 2010, the number of virtual machines exceeded physical machines in 2009, and will reach 10 million by the end of this year. This is definitely great news for the virtualization software industry but also a challenge moving forward.

So how should you try to solve the problem of virtual machine sprawl or even better, prevent it from happening? I discuss some solutions one by one here.

Creating Your Own Task and Event in vSphere

September 9th, 2010 33 comments

vSphere has a powerful extension mechanism that allows you to add new features as integral part of the platform. Many vendors have already leveraged this by providing plug-ins so that users can manage their components seamlessly within same vSphere Client.

You can actually do more than that with the extension. The following sample shows how to create your own task and event with vSphere API. The code should be self explanatory therefore I don’t elaborate much here. Note that you must run the sample with a vCenter server as extensibility is implemented only in vCenter.

When running the code, you can see a new task created and progresses with 10% every second in the “Recent Tasks” pane of vSphere Client. When the task is done, you will also see a new event posted in the “Tasks & Events” tab of the host you associate the task with.

What can you do with this capability? Here are two typical use cases:

Really Easy Ways to Capture VM Screenshot

September 8th, 2010 7 comments

Since vSphere 2.5, there is a feature allowing you to capture screen shot of a running virtual machine. It’s not well publicized but you can find a short description with screenshotSupported (boolean) in the HostCapability data object. Thanks to Nikita for bringing this up in the comment of the vSphere Java API 2.1 GA post.

Indicates whether the screenshot retrival over https is supported for this host’s virtual machines. If true, a screenshot can be retrieved at the HTTPS relative path /screen?id=<managed object ID of virtual machine or snapshot>. If any of the optional parameters ‘top’, ‘left’, ‘bottom’, and ‘right’ is specified, the returned image will be cropped from the rectangle with upper left corner (left, top) and bottom right corner (right – 1, bottom – 1). These values default to the top, left, bottom and right edges of the image. The client must use an authenticated session with privilege VirtualMachine.Interact.ConsoleInteract on the requested virtual machine or, in the case of a snapshot, the virtual machine associated with that snapshot.

The managed object ID of virtual machine is the value of ManagedObjectReference, which can be easily found using MOB.

Once you have it, you can issue a URL as follows in any browser and get the screen shot in PNG format.

How to Get Metadata of VMware vSphere API?

September 7th, 2010 No comments

VMware vSphere API is defined by WSDL. As discussed in my previous blog REST or SOAP, Web Services is by nature procedural, and it does not support OO (object oriented). This contributes to the learning curve of vSphere Web Service API which is modeled with OO.

What if you want to find out what properties are supported by a particular managed object type in vSphere API? There was a specific question recently in blog comment: how to get valid/supported property paths like summary.hardware.numNics with HostSystem type.

Currently there is no systematically way to get this metadata which is not defined in WSDL. You have to manually read through vSphere API Reference.

Since vSphere Java API 1.0 (a.k.a. VI Java API by then), I have manually added a getter method for every property in the Java API. So the metadata is built in vSphere Java API from the beginning. Whenever there is a manual process, it could be error-prone. As much carefully as I liked, I made mistakes with properties ignored in vSphere Java API occasionally. These mistakes have been immediately patched up upon bug reports or self reviewing.

To get exactly what you want programmatically, you have to do something extra with Java reflection API. Let’s pick HostSystem as an example here.

vSphere Java API at VMworld 2010

September 6th, 2010 No comments

Last week was a super busy week for all the people involved in VMworld 2010 in San Francisco. Because I spent two hours driving to Moscone Center and back home, I didn’t write any blog after getting back totally exhausted. Now it’s time to get back to it.

I believe there are many blogs/news on VMworld in general. Let me get down to a much narrow part: VMware Sponsored open source vSphere Java API at VMworld 2010.

Thanks to the community, my presentation on vSphere API Best Practice went very well. It’s based on the top 10 best practices blog (part 1, part 2) I wrote early this year, with real world experiences shared with partner engagements. Two copies of my book were given away at the end of the presentation. Thanks to Pablo Roesch for getting the books!

After the presentation, I was invited to check out new products built on top of vSphere Java API. I cannot disclose all of them here because some are not yet on the poweredby page. Here are several companies I can publicly talk about:

Ruby to Manage and Automate VMware vSphere?

August 30th, 2010 No comments

As I mentioned in a previous blog, vSphere(VI) Java API can be used in any JVM languages/frameworks. We have samples in Jython, Groovy, Grail. This weekend I got a sample in JRuby shared by our community member Martin Jackson in the API forum. Thanks Martin!

I think it would be fun to share it with you. If you can write Ruby code, you can take advantage of VI Java API for managing and automating vSphere as well. If you have samples leveraging the API to share, I am happy to hear about it.

Now, let us take a look at Martin’s sample code ported from a VI Java API sample.

Eclipse Day at GooglePlex: A Brief Trip Report

August 27th, 2010 No comments

I attended Eclipse Day at Google headquarter today. It’s a great event packed with several great talks.

Mobile application is for sure a hot topic these days. There were several talks on mobile application development like Android Tools for Eclipse by Xavier Ducrohet from Google, Eclipse Sequoyah for Android App Developers by Eric Cloninger from Motorola, Tools for Mobile Web by Paul Beusterien from Symbian Foundation, and EMF for GWT by Ed Merks from Cloudsmith.

While sitting in the talk on Instantiations Eclipse Tools, I learned that Google bought the company 3 weeks ago. I expect Google will soon make WindowsBuilder, a famous WYSIWYG GUI authoring tool, free for GWT users, therefore further drive the adoption of GWT in competition with Flex, SilverLight.

vSphere Java API 3.0 Kicks off, code name “Crescendo”

August 26th, 2010 11 comments

WIth 2.1 GAed yesterday, I am happy to announce the 3.0 project kicks off officially. For more fun, I picked up a code name for 3.0 release: Crescendo. For folks know music, crescendo means music gets louder and louder. That is where I want to bring the project to. It’s been a huge success for this VMware sponsored open source project. We’ve had 9,000+ downloads, plus 1000+ SVN code sync, after its first debut in 2008.

So where are we going next?

Before answering the question, let’s take a look at the themes of previous releases. The theme of 1.0 was ease of use with full object model and getter methods hiding property collector. The theme of 2.0 was Just Enough High Performance Web Service Engine resulted in not only performance boost, but also clean license with pure BSD, and much smaller footprint and zero memory leak.

Now it’s time to re-visit ease of use again, but from a different perspective. As I discussed early, the learning curve of vSphere API comes from two folds: lack of object model, and complexity of data objects. The 1.0 release solved the problem nicely. Now it’s time to tackle the second one.

Categories: vSphere API Tags:

Announcing vSphere Java API 2.1 GA Release

August 26th, 2010 10 comments

Right after vSphere 4.1 released, VI Java API 2.1 beta supporting vSphere 4.1 was released on July 15. After 40 days, I am pleased to announce GA of the 2.1 release. Many thanks to all vijava community memembers who helped to try 2.1 beta and give feedbacks.

The 2.1 beta is pretty good in terms of quality. I got several emails reporting greeen. I did get several bugs, some of which are carry-overs that should have been fixed in previous releases. Check the end of this blog for a list of bug fixes.

During the beta period, I started a poweredby page which now features 10 companies/products which use vijava API. If you would like your organizations/products included, please let me know.

Enough being said, are you ready to give 2.1 a try? Please feel to download it here. Even you are new to this API, 5 minutes is good enough to have your first HelloVSphere running with this tutorial.

Categories: vSphere API Tags: ,

Tipping points: the Social Aspect of Cloud Computing

August 25th, 2010 2 comments

Many people already know the book “The Tipping Point: How Little Things Can Make a Big Difference.” According to the author Malcolm Gladwell, tipping points are “the levels at which the momentum for change becomes unstoppable.” He defines the term as sociological and uses it to explain sociological epidemics.

Three Rules of Epidemics

In his book, Gladwell laid out the “three rules of epidemics” as follows:

1) The Law of the Few.
“The success of any kind of social epidemic is heavily dependent on the involvement of people with a particular and rare set of social gifts.” The author categorized people into Connectors who link us up with the world; Mavens who are “people we rely upon to connect us with new information;” and Salesmen who are charismatic persuaders.

2) The Stickiness Factor
The specific content of a message that renders its impact memorable.

3) The Power of Context
Human behavior is sensitive to and strongly influenced by its environment.

Although the research comes from sociology, I think it applies to technology as well. After all, technology is social. Just think about social networks like Facebook, and the recent success of Apple’s iPad.

If you want your technology to be a huge success, you cannot ignore its social side story. In the end, it is human beings who make decisions regarding any technology adoption or product purchase.

Secret of vApp Template in vSphere

August 24th, 2010 1 comment

My colleagues and I had a discussion regarding the vApp template. After virtual machine template for virtual machine, you would expect vApp template for vApp and manage it in a similar way from the vSphere Client. But you cannot.

Most of us know that from vSphere Client, you have context menu item allowing you to convert a virtual machine to a template easily with a click. However you cannot find a similar menu item with a vApp. You can choose to convert a virtual machine inside a vApp, but then the converted template will jump out of the vApp container.

Can we have vApp template? The answer is we can, but in a different way.

Restriction with User Name in ESX 4.1

August 23rd, 2010 2 comments

According to a recent post by Duncan, there is an issue with password in ESX(i) 4.1. Only the first 8 characters of a password are taken and validated. A VMware KB article offered solutions to this issue.

Categories: vSphere API Tags: , ,

How to Get Event Type with vSphere API?

August 19th, 2010 12 comments

There is a recent question asking how to get the type of event from vSphere API in my previous blog. On one hand, you can clearly see the types of events on a vSphere Client, for instance “info”, “warning”, “error”, and “user.” On the other hand, you cannot find any information about the type from a given event itself using vSphere API.

Strictly speaking an event just indicates something has happened. That is it. You can categorize it differently depending on your goal. The Event type itself in vSphere API models an event as what it is, not about how you look at it. This is a right design philosophy, but turns out to be a little tricky for you to figure out the type of an event.

How does vSphere Client do the trick?

Categories: vSphere API Tags: , ,

InterCloud vs. Internet: What’s Missing in Cloud Computing?

August 18th, 2010 3 comments

As more and more clouds go live, it’s time to think about how they will need to interconnect and interact. InterCloud is a new terminology coined for cloud computing after Internet for networking.

Vint Cerf, the “father” of the Internet, said recently that the cloud is much like networking in 1973 when computer networks couldn’t connect or interact. He called for open standards for cloud computing so that InterCloud can become a reality.

It’s hard to design standards when people are still trying to reach a consensus on defining what a cloud is in the first place! The good news is that as an industry we went through a similar process for the Internet. So we can learn from that experience.

The idea is simple: look at basic building blocks we have for the Internet and think about their equivalent for the InterCloud. Believe it or not, InterCloud and Internet share many common characteristics. The following table summarizes some of these.

Manage Lockdown Mode with New API in vSphere 4.1

August 17th, 2010 No comments

As a feature, lockdown mode has been added to vSphere 4.0 . Enabling it disables all remote root access to an ESXi machine. Any local changes to the host must be using:

  • DCUI (Direct Console User Interface).
  • vSphere Client or vCLI connecting to vCenter.
  • vSphere Client or vCLI connecting to ESXi with a local user account on the host.

My colleague Duncan Epping has summarized a table showing whether you can change ESXi with different access methods in two modes.

As a general practice for better security, it’s recommended to enable lockdown mode. However the lockdown mode could be breached by adding root user to local groups,

How to Get ESX Version from vCenter?

August 16th, 2010 4 comments

There is a recent question in vSphere(VI) Java API forum about this. On its face, it’s very easy because most people know how to get hold of the version as follows: 

String version = si.getAboutInfo().getVersion();

The si in the above code is the variable of ServiceInstance object. If you have never used the API yet, please try this Getting Started Tutorial which shows how to get your first program running from scratch in 5 minutes

If you are connecting to a vCenter server and try to get the version of a HostSystem the vCenter manages, it’s not so obvious. But it’s definitely doable. Here is the solution assuming you already get hold of the HostSystem object as host variable here: 

String version = host.getConfig().getProduct().getVersion();

Here you know why. First, the aboutInfo is now called product although they are of the same type. Second, it’s hidden within the config property. 

Before taking the code away, I would like to share with you an important tip for better performance. 

Categories: vSphere API Tags: ,