Archive

Archive for the ‘Virtualization’ Category

Released: vSphere Java API 2.1 Beta for vSphere 4.1

July 16th, 2010 16 comments

Following the vSphere 4.1 release, I am pleased to announce the release of the vSphere(VI) Java API 2.1 beta that fully supports the vSphere 4.1. The 2.1 beta has been ready for limited access for months by VMware internal teams, and partners/customers who participated vSphere 4.1 beta program.

Categories: vSphere API Tags:

What’s New in vSphere 4.1 API?

July 15th, 2010 No comments

VMware announced GA of vSphere 4.1 product this Tuesday. Here is the official what’s new in vSphere 4.1. Many bloggers already covered different aspects of the product itself: VMware vSphere 4.1: Advancing the Platform for Cloud ComputingUseful vSphere 4.1 knowledgebase articlesvSphere 4.1 releasedRelease: VMware vSphere 4.1, etc. I don’t repeat these here, but focus on the new APIs in 4.1 release.

In general, the APIs are the programatic “view” of features. Understanding the features helps a lot on understanding the APIs. So I strongly encourage you to read new features of the product itself. Note that not all the new features especially the performance and scalability features are explicitly reflected in API signatures.

vSphere API 4.1 introduces 7 new managed object types:

vSphere 4.1 adds 23 new methods to 10 existing managed object types:

Categories: vSphere API Tags: ,

VMware Wants to Hear from You about vShere Java API

July 2nd, 2010 No comments

VMware launches an official survey on the open source vSphere(VI) Java API. Please let the company know your take on the open source project, and what you want, for example, formal developer support, etc.

The survey includes 16 simple questions and should take no more than 3 minutes to finish. All the collected information is confidential.

Note that the survey result decides what to come next. Please make sure your voice heard by taking the survey here.

Categories: vSphere API Tags:

vSphere Java API 2.1 Beta Is Ready For Limited Access

June 28th, 2010 No comments

I have finished vSphere(VI) Java API 2.1 beta last week. The major feature is to support next version of vSphere. The company legal also approved the contribution to the open source project after product release.

Because VMware hasn’t released the next version of product yet, I cannot release the code to general public for the moment. API and product are much like the view and model in MVC: from the new APIs you can guess what new features are in the coming product.

Categories: vSphere API Tags: ,

How to Extend vSphere Java API?

June 21st, 2010 7 comments

I got a request a while back for extending the vSphere Java API. The idea is that the API itself is pretty basic and not high level enough for some applications. For example, if you want to add a virtual NIC to a virtual machine, there is no explicit method for doing this. Fair enough.

Now, how to achieve this?

Three possible approaches

  1. Change the structure of the API. For every managed object type, we have two types: one with implementation, and the other inheriting the first one but really empty. The user can replace the first second one with extra methods as extensions. This approach is smart, but will cause confusion in the future. For instance, we will have many different implementations for the sample types.
  2. Use composition. You can create a new type that contains an instance of a managed object. How to expose the methods of the managed object? You can either manually add them to the containing type, or expose the instance of the managed object so that others can call its methods.
  3. Use inheritance. You can create a new type that inherits a managed object type. Once you get an instance of a normal managed object, you can pass into the constructor of extended managed object type. You can use the extended type anywhere a normal type is expected. Let’s pick VirtualMachine as an example,
Categories: vSphere API Tags: ,

How to Notify All the Active vSphere Users?

June 16th, 2010 No comments

As system administrators, you may have used the feature that sends a message to all users. It’s very helpful when you want to change something that might affect others, or ask for particular attention from new users who log in later.

It’s simply 3 steps as described vSphere Client Help:

  1. From the Home page of the vSphere Client, click Sessions.
  2. Type the message in the Message of the day box.
  3. Click Change.

The message is sent to all the currently login users, and until the message is changed, any new users see the message upon logining to the vCenter.

Now, how to do with the API?

Categories: vSphere API Tags: ,

Web-Based Datastore Browser in vSphere

June 14th, 2010 2 comments

Most of us are familiar with MOB, the Web based managed object browser.I’ve discussed the little known secret of it, and built a tiny yet powerful API on top of it.

There is yet another useful tool in vSphere you can leverage: Web based datastore browser. This tool allows you to use a standard Web browser to browse the datastores. You can access it using the following URL:

Really Easy Way to Find out What’s New in vSphere API

June 1st, 2010 1 comment

I am probably one of a few persons who read the VMware vSphere API reference extensively because of my book. When I read it, I normally quickly click the Managed Object Types link in navigation pane on the left side, and then choose one type for the details on the right side.

Categories: vSphere API Tags:

Continuous Deployment With Virtualization and Cloud: An Idea for Startups

May 28th, 2010 2 comments

If you have a new hire, do you want him/her to push code into production system on the very first day? You may be OK with this sometimes. What if it’s a trading system with real money involved? More often than not, you come up with a different answer.

On Wednesday night, I attended a seminar organized by SDForum SAM SIG at LinkedIn headquarter. Pascal-Louis Perez and David Fortunato from Kaching.com engineering team gave a great talk on how they streamlined their software development process to the extent that they normally release 20 times a day to their production system. It’s quite a safe process that it’s OK for a new hire to push code on day one.

VMware SDK Support Program: It’s Available to Everyone

May 25th, 2010 2 comments

Many people know VMware offers support on products, but not many know VMware actually started to support SDKs. I occasionally got questions on the SDK support. So I think a blog should help here.

A little history first. VMware used to provide support to partners who are part of Technical Alliance Program (TAP), but not to others including customer. VMware partners can also propose integration projects which may get people like me to provide architectual guidance. After SpringSource coming on board, Marty Messer took over the support program and expanded it to everyone as a paid service recently.

What You Can Buy?

The paid support is available in two levels:

Categories: vSphere API Tags: ,

VMware vSphere Fault Model and Common Faults

May 24th, 2010 No comments

A fault is like an exception in Java or another modern programming language. It’s a data structure that holds information about an exceptional situation. Most of the faults are raised by the server; you can normally determine the cause from their fault names.

Close to 300 fault types are defined in the vSphere API. Let’s look at the top level hierarchy shown as follows.

 

The supertype for all faults is MethodFault. It is extended by InvalidCollectorVersion, InvalidProperty, RuntimeFault, and VimFault. The first two faults are not further extended to any other fault types.

Categories: vSphere API Tags: ,

Innovation, Openness, Community: Celebrating 2nd Anniversary of vSphere Java API

May 21st, 2010 No comments

It’s been two years since the first release of VI Java API on May 22, 2008. As of today, this VMware sponsored open source API has been downloaded more than 8,200 times including 1,000+ direct access to the source code from SVN. More importantly, the API has been widely adopted by VMware Community including partners and customers in their products and operation environment. I was amazed to hear success stories from companies which use this API to manage 10,000 servers.

Besides Java, people also started to use JVM languages such as Jython and Groovy to leverage the API. I think that is the direction for the API to be used by system administrators who look for an alternative to vSphere PowerCLI which is a great product with no choice but on Windows only.

How Was It Started?

The API was started because of my personal experience while helping VMware strategic partners. I found the Web Services SDK hard to use, and related samples hard to follow because of the procedural nature of Web Services. So I started to think how to solve the problem. During March and April 2008, I wrote code every night on my old Compaq notebook after helping my kid to sleep at night.

Categories: vSphere API Tags:

Two More Jython Samples Managing VMware vSphere

May 18th, 2010 2 comments

Yesterday I posted an article introducing the virtual appliance Timo created last week. I am sure some of you have given it a try. I hope you liked it. If you haven’t done so, you can download it from Timo’s post.

The virtual appliance ships with only two samples. Definitely not enough. That is why the community needs to work together so that we can match the functionalities of vSphere PowerCLI.

The following are two samples by David Rousseau who is an independent consultant living in Paris. Thanks for his permission to publish his code here. He owns the copyright of the code. If you want to use it, you can contact him or leave a message in this post.

  1. jython_rest.py: This code shows how to use the tiny Client REST API I created. Check out this article for more details of the API itself.
  2. jython_test.py: list all the hosts, resource pools, virtual machines and vApps that are found at the server.

To help you understand the code, I added a little comment before each file.

VMware vSphere PowerCLI Alternative on Linux?

May 17th, 2010 3 comments

After creating a light virtual appliance last year, Timo Sugliani continued with a full fledged version of virtual appliance with all you need for vSphere development with Java and Jython. This is what Timo called “my linux powershell toolkit.” The biggest advantage is that you are no longer limited by Windows as your development platform.

How to Enable ESX Server Logs for Troubleshooting

May 12th, 2010 6 comments

Examining logs is an important way for debugging and troubleshooting a system. There are about ten log files in the ESX server for the hostd agent, which listens API calls, with the same naming pattern as hostd-?.log under the /var/log/vmware directory. The hostd-index file has the number of currently used log files.

The log entry has a similar format to that of VC server logs. Following is a quick sample:

[2008-06-21 07:24:40.769 ‘SOAP’ 64834480 trivia] Received soap request from []: checkForUpdates

The log level can be configured in the /etc/vmware/vpxa.cfg file. Just look for a section like the following. The possible levels are the same as those of VC logs: none, error, warning,info, verbose, or trivia, in an order from less to more detailed messages.

How to Fix Task Timeout in vSphere?

May 11th, 2010 No comments

Task management is an important part of vSphere API. It enables asynchronous calls by returning a Task back before the work is actually done at the server side. If a task takes too long (for example, more than 15 minutes to create a virtualmachine snapshot from VirtualCenter), however, it can time out before it finishes. It means you lose tracking of the task.

You can easily fix this issue by changing the configurations. On the ESX server, add the following to the /etc/opt/vmware/vpxa/vpxa.cfg file:

<task>
<timeout>7200</timeout>
</task>

and

<vmomi>
<soapStubAdapter>
<blockingTimeoutSeconds>7200</blockingTimeoutSeconds>
</soapStubAdapter>
</vmomi>

Remember to restart the service:

Categories: vSphere API Tags: , ,

Attention Administrators: vSphere Java API is for You too!

May 10th, 2010 No comments

Most people have the perception that vSphere Java API is for developers. It’s true but actually more than that. Administrators can take advantage of it as well.

Today, William Lam (@lamw) posted a Java version of his vdf tool which was originally written in Perl. For people don’t know William yet, he is a system administrator at Salesforce.com now and Yahoo before. He created and maintains the famous vGehtto script repository that almost every VI Perl developer knows about. William is also a vExpert and the No.1 contributor to the VMware developer community. Having not touched Java for 4+ years, William got his first HelloVM with VI Java API working in less than 5 minutes, and got the code converted in about one hour.

Categories: vSphere API Tags: , , ,

4 Rules for Converting Onyx Generated Code

May 5th, 2010 No comments

VMware PM Carter Shanklin (@cshanklin) once gave a great presentation on how to use Onyx with Java development at PEX 2010. I covered it briefly in a previous blog, and left out the “4 rules” hoping Carter would help.

As many of you have already known, Carter moved on to SpringSource division as the PM for tc server. So he has been pretty busy with his transition. With his coverage on both administrator and developer oriented products, he is right on the wave of devops movement. Make sure you follow him at Twitter.

Categories: vSphere API Tags: , ,

Tutorial: Easy vSphere Web Apps with Grails and the VI Java API

May 3rd, 2010 No comments

In a previous post, I blogged about a tutorial on using the open source VI Java API in Groovy by Aaron Sweemer. Two weeks later, he wrote a new tutorial Easy vSphere Web Apps with Grails and the VI Java API.

In his new tutorial, Aaron introduced detailed steps in how to use the VI Java API for a simple web application with Grails framework. The web application displays a web page that lists all the virtual machines with the corresponding guest OS names and whether they support multiple snapshots.

Categories: vSphere API Tags: ,

Really Easy Way to Clone a Session: Yet Another Contribution from NetApp

April 26th, 2010 1 comment

Recently there were questions in the vSphere Java API forum on how to clone a new session from an existing one. Although vSphere Java API wraps around the basic Web Services API cloneSession() method, simply calling the method doesn’t get what you want.

Why? The signature of cloneSession() is as follows. It returns UserSession, which is embedded inside ServiceInstance managed object in vSphere Java API. While using the API, you always starts from the ServiceInstance.

public UserSession cloneSession(String cloneTicket) throws InvalidLogin, RuntimeFault, RemoteException;

In vSphere Java API, the ServiceInstance and UserSession have one to one mapping. Without a new ServiceInstance around the new UserSession, the UserSession is not much helpful.

Luckily, we got yet another contribution from Eric Forgette who works at NetApp. The contributed code includes a new overloaded method cloneSession() method to return a ServiceInstance object.

As I described before, we’ve been trying very hard to keep the vSphere Java API as close to the basic Web Services as possible. In this case, we decided to break the rule a little bit for good reasons, mainly for usability.

Categories: vSphere API Tags: ,