Introducing VMware vCenter Chargeback API

March 22nd, 2011 No comments

Chargeback is an important feature for computing infrastructures. Even inside an enterprise where IT users are not charged with real money, it’s still nice to see the usage patterns and sometimes avoid wasting resources. As I mentioned in IBM RC2, applying chargeback reduced unnecessary usage overnight.

VMware vCenter Chargeback is a component for this purpose. It can run standalone with Web GUI, and surface to vSphere Client as a plug-in. Although its name includes vCenter, it can also work with vCloud Director (see Using vCenter Chargeback with VMware Cloud Director).

I just spent some time over the weekend reading the API documentation, including vCenter Chargeback API Programming Guide, API Reference. The version 1.5 of the API

Soft Communication and Hard Communication

March 21st, 2011 No comments

Communication is always important in any teamwork environment. This is especially true in software development where changes are constant. There are two levels of possible communications in software development: soft communication and hard communication. Let’s go over them one by one.

Soft Communication

It happens among people, those who work on a software project. Two popular forms of soft communication are

Finding out Guest OS Running on a Virtual Machine

March 18th, 2011 5 comments

 

 

VMware ESX and ESXi (a.k.a. vSphere Hypervisor) support the most guest operating systems among all the hypervisors. From the vSphere API, you can determine what operating system is installed on a virtual machine.

The related managed object is the VirtualMachine and there are multiple ways to

Quickest Way To Ramp Up In New Software Projects

March 14th, 2011 No comments

If you are a software engineer, you may move from project to project over the time. How to quickly ramp up with a new project is always a challenge. The term “new” I use here does not mean that the project is new and you need to start from scratch, but that the project is new to you.

Although we all like to start from scratch, the reality is that 80% of engineers are actually doing maintenance works on existing projects: fixing bugs, adding new features, etc.

When you move to a new project, you have to

Developing Java Client to Adobe BlazeDS

March 9th, 2011 9 comments

If you develop FLEX with Java backend, you most likely know BlazeDS already. It’s a web application running with Tomcat that exposes Java objects on the server side as services to the Flex Client written in ActionScript. It combines the best of Flex on the client side and Java on the server side. As a result, it becomes one of the most popular architectural styles for web development these days.

It’s less known that you can also develop Java code on the client that consumes the services on the server side. Check out this wiki page by Adobe on the original design. The implementation of Java AMF Client is added to BlazeDS as of July 2008.

Because I had to hack

Categories: Software Development Tags: ,

Two Developers in VMware Community

March 9th, 2011 No comments

Many folks talk about developer enablement today because it’s a key success factor for a platform company. If you haven’t watched this video by Microsoft CEO Steve Ballmer, you want to check it out. Also, my previous blog: CO2: The Formula For A Successful Developer Ecosystem.

To empower developers, we got to figure out who the developers are and what they want. It’s hard, if ever possible, to identify every developer in VMware community. But it’s normally easy to find out the types of the developers. In my observation, there are two types of developers (The title of this article is not that accurate, but

Released: VMware vSphere API and SDK FAQ

March 6th, 2011 25 comments

After working on this for weeks, I am pleased to announce the first release of VMware vSphere API and SDK Frequently Asked Questions. It includes 70+ questions and trustable answers in 6 different categories: General, Getting Started, Language Bindings, VI Java API, API Usage, Troubleshooting.

From now on, before posting any question to any forum please read this FAQ page. For the best readability, I decided not to allow comments on that page. But your feedbacks and suggestions are always important. Please feel free to use this post for comments and discussions. Based on your inputs, I will continue to enhance the FAQs.

Categories: vSphere API Tags: , , ,

How to Get a Managed Object With Its ID Like task-id?

March 3rd, 2011 1 comment

The open source VI Java API has implemented typing which makes it much easier to use and possible to catch errors in compile time. To use these types, you have to get hold of these objects. Normally you don’t need to worry about this because you navigate the system from the top ServiceInstance and get the managed objects through VI Java API calls.

There are some rare cases in which you get the object id first, for example, a task id as asked in the VI Java API forum. A bit more common case is when you develop vSphere Client plug-ins. The URL string your web application gets has object id and type for a virtual machine or host, etc.

Although coming from different use cases,

Categories: vSphere API Tags:

How to Set up Connection Timeout in VI Java API

March 2nd, 2011 13 comments

Per community requests, two methods were added into VI Java API 2.1 (GAed last summer) for changing the default connection and read timeouts. Both methods are defined in WSClient.java.

The first method setConnectTimeout() sets a specified timeout in milliseconds. It intends to be used when opening a communications link to the resource referenced by the URLConnection inside the WSClient object. If the timeout expires before the connection can be established, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout.

The second method setReadTimeout()

Categories: vSphere API Tags:

Franchising Business Model for Cloud Computing

February 28th, 2011 No comments

In a previous post, I said that cloud service business model is very much like that of office renting business. Just as big companies want to own their major offices, they want to own their major datacenters as well. That explains why private cloud will not only be there forever but also represent a major chuck of overall market in the future.

Cloud Commoditization

Let’s get back to the cloud service business, or so called public cloud. When the cloud technology getting mature, the cloud related services will increasingly become commoditized. This is especially true

How to Set Up Proxy With VI Java API?

February 27th, 2011 No comments

It’s common for companies to proxy HTTP traffics to external Web site, but not so for internal sites. Therefore, you rarely need to set up proxy for using vSphere API calls with an internal vCenter server. The uncommon cases do come up sometimes. This post explains how to set it up for vSphere API. Note that this is not really for VI Java API only but applicable for all Java applications.

There are two options and you can pick either of them per your use case:

Categories: vSphere API Tags: ,

Use Java Technology to Fight Twitter SPAMs

February 27th, 2011 No comments

I got quite a few SPAMs on my twitter last week. While it’s annoying to be spammed, I did pay a little attention to the spammers and noticed that their commonality: big number of tweets, 0 following, 0 follower.

These characteristics reminded me of the Java virtual machine technology to garbage collect unused Java objects. In Java, you don’t need to explicitly de-allocate memory as in C++. The Java garbage collector (GC) takes care of this for you. It looks at the objects to see if there is any reference to it. If not, it deletes the objects.

In the Twitter case, a follower is

Categories: Software Development Tags: ,

A Gap In Object Oriented Methodology

February 24th, 2011 2 comments

There have been long debates on whether object oriented is the future of programming. Repeating it over here doesn’t make it any clearer. As you can tell from my blog, I am an OO bigot because it can significantly improve productivity. If you are not convinced about OO benefit, you can look around those top programming languages mostly support OO these days.

By reviewing the whole software lifecycle, however, you will find a gap between requirements and OO programming today. While describing application requirements, a business user almost always describe them in a number of steps (procedural). It’s not realistic to expect requirements described in an OO way. While developing, programmers write and see classes and objects.

How to bridge the gap between the procedural requirements and object oriented programming? It basically boils down how to

Welcome Cisco to Open Source VI Java Community

February 23rd, 2011 No comments

It gives me great pleasure to welcome Cisco to our open source community. Given the brand recognition of Cisco, I don’t need to explain much about the significance of its becoming part of our community.

At the end of 2009, a development team at Cisco contacted me, and then started to use the VI Java API for integration with VMware vSphere. Like many other partners, they succeeded. Here is a paragraph I received from Andrew Levin (product manager) and Louis Jia (development manager). Thanks Andrew and Louis!

Introducing VMware vShield REST API

February 22nd, 2011 6 comments

One of my colleagues asked me about vShield API and pointed me to the vShield API Programming Guide. I have of course heard about the vShield many times, but haven’t tried it out, let alone its API. But that doesn’t mean I cannot read it on demand. In fact, such questions motivate me to learn more beyond vSphere API. So keep your questions coming if you have one.

Here is what I found out after reading the programming guide. I have to admit I haven’t written any code connecting to a vShield test-bed, so I just share some basics of the API. Overall I found it’s similar to the vCloud API that I had worked with before in format and protocol.

Somehow the API does not, but I think should,

vSphere SDK Compatibility

February 21st, 2011 No comments

Last week an issue was reported with using vSphere SDK 4.1 to connect vSphere 4.0. The problem is related to the HTTP header called “SOAPAction” introduced in vSphere SDK 4.0. A recent KB article introduced this header, but with a minor error. I will talk about it in the end.

With vSphere SDK 4.1, the SOAPAction header has a value of “urn:vim25/4.1” while 4.0 has “urn:vim25/4.0”. For an older version of vSphere server, either vCenter or ESX/ESXi, it has no idea of the new value of SOAPAction, therefore refuse to serve. But the other way around works just fine because the newer version of vSphere knows about the older value but also support the older version of SDK directly. As a result, any application using older version of SDK works with newer version of vSphere. I am not saying your application can leverage new features. In fact, you cannot and must upgrade to do so.

From the SDK part, I found it’s a little disturbing when your newer SDK cannot work with older vSphere. We all expert newer SDK are better and back compatible. That is why

Introducing PowerShell CLIs for VMware View

February 16th, 2011 2 comments

Two weeks ago when I twitted about VMware View APIs, several folks asked me if and where they could find View APIs. While VMware does not provide a full set of APIs, but does offer PowerShell based CLI as documented in the VMware View Integration Guide.

Beyond that, the guide also introduces the event database with tables and schemas so that you can retrieve various events from the database directly; how to import/export LDAP data to/from View; and how to “use Microsoft System Center Operations Manager (SCOM) to monitor the state of VMware View components, including View Connection Server instances and security servers and View services running on these hosts.”

While trying the PowerShell CLI,

Categories: Virtualization Tags: , ,

Big Bang: The Story of How A Cloud Is Created

February 15th, 2011 No comments

I believe most of us learned at school the theory of big bang which tries to explain the formation of the universe. “According to the Big Bang model, the universe, originally in an extremely hot and dense state that expanded rapidly, has since cooled by expanding to the present diluted state, and continues to expand today.” (source: Wikipedia).

Now how does the theory relate to the cloud computing? More than you can think of. You can use the same theory to create (not just explain) a new cloud. Just like the universe, a cloud is created from almost nothing to a fully running infrastructure over time. Think about most enterprises which do not yet have a cloud today, they will need a big bang to create an enterprise cloud.

Basic Elements of a Cloud

It’s important to understand what you want before taking any action. To operate a cloud,

How to Enable or Disable Copy and Paste to Remote VM Console?

February 14th, 2011 No comments

In my previous post, I introduced how to change a virtual machine’s vmx file programmatically and promised to post a full sample in my presentation at VMware Parter Exchange 2011. Now that the conference is over, it’s time to post it.

The sample is based on guideline VMX03 in vSphere security hardening guide: disable copy/paste to remote console. To me, allowing copy and paste to remote console like vSphere Client is a nice feature which can save you a lot of time. When security is a concern, however, you may want to disable it.

I will not discuss when you should disable/enable it because it really depends on your requirements. In most cases, security and convenience contradict with each other. I leave it for you to decide the right balance, but show you how you can check the setting and change it here.

Like most samples I write,

VMware PEX 2011 – Day Four

February 11th, 2011 2 comments

Today is the last day of VMware Partner Exchange 2011. I am now sitting at Orlando airport writing this post. It will be a long way heading back to Silicon Valley.

My presentation today is about security from API perspective. It’s mainly not about the security best practices or guidelines as captured in the vSphere security hardening guidelines, but about how to automate the checking and hardening process. I introduced the security model in vSphere and the techniques and samples on patching up vulnerabilities with vSphere API.

Although vSphere API is very powerful,

Categories: News & Events Tags: ,