Archive

Archive for the ‘Virtualization’ Category

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: ,

Synchronous versus Asynchronous Calls in vSphere API

April 22nd, 2010 No comments

In a previous article Top 10 Best Practices Using VMware VI and vSphere SDK, I mentioned synchronous versus asynchronous calls in the second best practice “Choose Right APIs.” But no detail was provided there. In this article, which is based on my book VMware VI and vSphere SDK , I discuss all the details.

Some methods defined on managed objects in vSphere API are asynchronous, meaning they return right away whether the operations are done successfully or not. That makes sense for long-running operations; you don’t want to block your current thread by waiting for the return of the call, and you might want to cancel it before it’s done.

For these asynchronous methods, the VI SDK provides a way to track the progress and results after the invocation is returned. As a naming convention, a long-running asynchronous method has _Task as a suffix in the method name, and it returns MOR to a Task. With MOR pointing to the Task object, you can track the progress and even get the result of the operation. For example, the cloneVM_Task() method defined in VirtualMachine is a long-running method that returns MOR pointing to a Task managed object.

Categories: vSphere API Tags: ,

Tutorial: Easy VMware Development with VI Java API and Groovy

April 20th, 2010 4 comments

Every time I google for VI(vSphere) Java API, I get something new. Here is yet another one I just found. It’s a blog article Easy VMware Development with VI Java API and Groovy by Aaron Sweemer. By reading his blog site, I came to know Aaron is actually my colleague at VMware working as a Sr. System Engineer in Cincinnati Ohio. He is the principal blogger at Virtual Insanity.

Virtual Appliance: Is It a Virtual Machine or an Application?

April 19th, 2010 6 comments

With the growth of virtualization, a new term “virtual appliance” has been coined for a special type of virtual machines that are used like applications. What does it really mean?

First, a virtual appliance is still a virtual machine. When seen in vSphere Client, the virtual appliance does not look much different from other typical virtual machines. Secondly, the functionality of the virtual machine is limited to that of an application. More often than not, the virtual machine is installed with one application. Because of this, the underlying OS is stripped down only to the minimum required to support that application. This type of OS is also called Just Enough OS (JEOS). All the existence of the JEOS is to support the application in the virtual appliance.

Now, is it a VM or an application? It could be either, depending how you look at it. For ESX/vCenter, a virtual appliance is a virtual machine. You can manage it just like any other virtual machine. For application users, it’s an application, a special one that is different from a normal application.

How to Use HTTP with vSphere Client?

April 16th, 2010 No comments

If you have viewed the video about Onyx by Carter Shanklin (@cshanklin), you may have noticed a little trick with the vSphere Client.

Normally on the login dialog box, you enter a hostname or IP address. By default, the vSphere Client use HTTPS to communicate with the server. That means you cannot easily see what’s passed back and forth on the wire. As shown in the Onyx video, Carter showed how to use HTTP instead of the default HTTPS with the following in the IP Address / Name field:

http://localhost:1545

So the vSphere Client does support HTTP. In Onyx case, it points to localhost on which the Onyx is installed. You can actually point to a real vCenter or ESX/ESXi server directly – just change the localhost to the IP address of the server and the port to the default port 80 or remove the port part.

Before connecting the server, you need to change the server a bit for it to support HTTP. 

Categories: vSphere API Tags: , ,

Invalid property? A Trick With vSphere PropertyCollector

April 14th, 2010 9 comments

As I discussed extensively in my book, the PropertyCollector is very powerful yet not easy to use. There was a question posted at vSphere Java API forum related to the property collector which I think worths sharing here. Although it’s found using vSphere Java API, but it really goes beyond the API to the vSphere API itself.

Virtual Machine, IP Address, and MAC Address: Frequently Confused Concepts

April 13th, 2010 21 comments

Having answered many questions about IP addresses of virtual machines at different occasions, I still see more are coming. I think it’s time to write a blog about it. Hopefully people would search the Internet before raising the question.

First of all, there is a big confusion on the relationship of IP addresses and virtual machines. Many people tend to associate IP addresses with virtual machines, and want to retrieve/change the IP address of a virtual machine.

In fact, a virtual machine is very much like its physical counterpart. It does not have an IP address by itself. In other words, an IP address is NOT an intrinsic attribute of a machine, either virtual or physical. It might have one or more only after an OS is installed. In most cases, it does have one or more IP addresses, which gives the impression that every machine has an IP address.

A virtual machine does have intrinsic attributes such as MAC addresses if NIC cards are configured. Unlike its physical counterpart, a virtual machine’s MAC address can be re-configured. Some software vendors rely on MAC addresses to lock down their licensed software on particular machines. This mechanism can be, therefore, compromised in virtual environments.

Video on vSphere Java API Released at InfoQ

April 9th, 2010 2 comments

While searching Twitter on “vSphere Java”, I found my presentation available today online at InfoQ (many thanks to @arm1433 and @toya256ForRSS). It has both video and slides for more than one hour. The voice was not quite clear in the first one or two minutes. After that it’s pretty good.

This presenation is a complete overview of the open source vSphere Java API. Because the audience then was new to virtualization, the first several minutes covered a little virtualization basics. You can scroll over if you know virtualization already.

Categories: vSphere API Tags: ,

I18N vs. vSphere

April 8th, 2010 No comments

With today’s global market, a software vendor has to consider the internationalization (I18N) issue to better serve users in different areas and maximize the return on the product investment. This article introduces the I18N basics of vSphere. Much of the content is based on my book VMware VI and vSphere SDK by Prentice Hall.

There are two basic meanings. First, you have to design your software so that it is localizable. In other words, you have to use the right APIs that can handle double byte characters. Sometimes people call this globalization (G11N).

Second, you should provide localized versions of your software so that users can read and use their native languages. Sometimes people call this localization.

In most cases, you externalize all the text strings that are visible to end users from the code to the resource files and translate them into different languages. Then localizing the software is as easy as combining the code and localized resource files. This is the way VirtualCenter server is localized. Depending on the programming language and platform, the resource files can be organized differently and might have another format. For example, Java uses properties files, yet C++ on Windows uses resource dlls.

That said, I18N is a broad topic that does much more than what is briefly covered here. Further discussion is beyond the scope of this book, but you can find more detailed information online.

As discussed, the VI SDK is essentially a set of Web Services interfaces. The WS-I18N summarizes four internationalization patterns that can be applied with Web Services when deployed.

Categories: vSphere API Tags: , ,