Monthly Archives: January 2011

How to Change VMX Programmatically?

As most of you may have known, the vmx file is the most important file at the back of a virtual machine. It defines the configurations of a virtual machine for example virtual hardware version, devices, disk files, etc. That is why it owns the virtual machine icon when you look at all the files behind a virtual machine with either datastore browser in vSphere Client or VMware Workstation/Fusion.

Given the importance of the vmx file, we don’t recommend anyone to manually modify it given that messing it up may corrupt a virtual machine. You can change the content indirectly from GUI and APIs. If you can change the virtual devices of a virtual machine, its vmx file is changed accordingly.

Beyond basic configuration entries, the vmx file can be extended to hold key/value pairs. A vmx file is really a text file with many lines of key/value pairs. By extending it, you can add extra lines of key/value pairs at the end of the file. Keep in mind that you should NOT add any key that is duplicated with predefined keys like “virtualHW.version.” As you already noticed, the key has the “.” delimiter as namespace pattern. You can start with your own namespace to avoid possible name clash.

Posted in vSphere API | Tagged , , | 9 Responses

How to Differentiate Folders in vSphere

As we know Folder is a container object in vSphere. It’s used to hold other managed objects in a similar way as directory holding files in an OS. There is an interesting question asking in VI Java API forum on how to tell whether a folder is vmFolder or hostFolder. BTW, you don’t see these two folders displayed in vSphere Client.

The questioner guessed correctly that you can find out by a folder’s childType property. Here is the documentation in API reference on the possible values of the childType property:

Posted in vSphere API | Tagged , , | 4 Responses

Free ESXi and API/CLI support

I think there is a pretty good understanding on this topic, but questions still come up once in a while in VI Java API community and my inbox. Some people got errors while trying to manage free ESXi servers via API. The API support of free ESXi is limited to ready only according to a VMware KB article:

vCLI, PowerCLI, and vSphere SDk for Perl are limited to read-only access for the free vSphere Hypervisor edition. To enable full functionality of vCLI on a VMware ESXi host, the host must be licensed with vSphere Essentials, vSphere Essential Plus, vSphere Standard, vSphere Advanced, vSphere Enterprise, or vSphere Enterprise Plus.

Posted in vSphere API | Tagged , , , , | 9 Responses

Book Review: 6 Musts of Intelligent System Automation

I recently came across a book which I got from LISA conference last November. It was written by Jake Sorofman who is VP, Product/Marketing at rPath. I thought it’s just another typical book from a vendor, therefore I didn’t read it until two weeks ago while sorting my bags. It’s not. After reading it, I found this 75 page booklet pretty easy to read and very insightful.

Here are 6 musts Jake discussed in his book:

  1. Get your platforms under control
  2. Get your applications under control
  3. Version control everything
Posted in Cloud Computing | Tagged , | 1 Response

How You Can Use VI Java API in Scala: A Quick Sample

As I blogged before, you can use open source VI Java API in all JVM languages like Jython, Groovy, JRuby and frameworks like Grail. Today Dave Briccetti (@dcbriccetti) sent me a sample showing how to use it in Scala. Dave has been a happy user of the API since he started to work at VMware as an independent consultant more than a year ago.

Here is the code sample:

Posted in vSphere API | Tagged , , | Leave a comment

Cloud Architecture Patterns: VM Template


Standardize new virtual machine provisioning with templates


Creational pattern


It’s been a pain to create new virtual machines with the right software installed and configured properly. You can always use tools like KickStart to automatically install the operating system and then install other software as needed. But configuring such an environment is not trivial, and it takes a long time from start to finish.

With the rise of virtualization, more virtual machines are provisioned (and decommissioned) than ever before. Installing each new virtual machine from scratch is not the ideal solution.


Posted in Cloud Computing | Tagged , , , | Leave a comment

How to Delete Virtual Machine With vSphere API?

This question was asked at VI Java API forum recently and has been answered by the community.

There should be a “Destroy_Task()”-Method for each Managed Object, so also Virtual Machines…. Cheers, Joerg

As  Jörg Lew has correctly pointed out the solution, I would like to elaborate a bit more here.

If you are using VI Java API, the method name is destroy_Task(). The code is as simple as:

Posted in vSphere API | Tagged , , | 3 Responses

Difference of Two Common Privileges in vSphere API

If you have used vSphere API and read its API Reference, you may have noticed two most commonly used privileges: System.View and System.Read. They are required in many methods. As their names suggest they are different, but what is the difference? It can be confusing for some people including me initially because it’s nowhere documented.

Here are some explanations after my talking to my colleague Jianping Yang who is the vCenter DB and Security guru.

Posted in vSphere API | Tagged | Leave a comment

HP Chooses Open Source vSphere Java API

After NetApp, Brocade and many other companies showing up on the VI Java API poweredby page, we now have the world’s biggest technology company HP officially listed. HP started to use VI Java API about two years ago and has shipped products ever since. I have attended several meetings called by my colleague Lucas Nguyen to work with HP architect Zachary Speck and his team. Included in the following short paragraph is a link to the HP plugin product. Please feel free to check it out.

Posted in vSphere API | Tagged , | 2 Responses

Quickest Way to Support SaaS Cloud for ISVs

One challenge almost every ISV faces today is how to quickly get “cloudy” with least investment. From business side, SaaS is a new model for most ISVs, meaning it’s still hard to project revenue. Even worse, the SaaS service may cut into the license revenue of existing product. Technically, it may require a full re-design and re-implementation of product  for maximum multi-tenancy. Putting together, it’s a big challenge for decision makers.

But it doesn’t have to be difficult with a right strategy. This post explains how to support SaaS without re-designing existing applications, which means a big saving for the ISVs.

Posted in Cloud Computing | Tagged , , , | 3 Responses

How to Be a Smart IT Customer?

This is the last note I took from LISA 2010 conference. It’s a great talk by Loren Jan Wilson drawing his experience with vendors while working at a super computer center.

The super computer, Intrepid, consists of 40,960 nodes on 40 racks. Each node has 4 core CPU. Of all the nodes, 640 nodes are dedicated for I/O. There is no local storage at each node. The super computer links to a very large tape library for archiving.

While operating the super computer, the speaker had some issues with high-speed network switches, e.g. 6% random port death, 15% quad port flaky but never fail 100%. To complicate the issue, there is no log and CLI for troubleshooting, but Web interface.

I believe the trouble the speaker faced before is not a single case in the industry, and never be. As long as you have to buy equipment/software from vendors, there will be issues one way or the other. A great thing the speaker did is to summarize and share the tips on how a customer should work with an IT vendor for a successful IT project.

I find these tips are very helpful, and think customers and vendors should all know about them as listed below:

Posted in News & Events | Tagged , , , | Leave a comment

Cloud Architecture Patterns: Cloud Broker


Provide a single point of contact and management for multiple cloud service providers and maximize the benefits of leveraging multiple external clouds.




When you are buying and selling stocks or other securities, you hire a broker to execute the trade on your behalf. One reason for that is convenience. You don’t need to take care of the details of placing orders and working with multiple stock exchanges, and whatever else is required to trade securities.

How about working with multiple cloud service providers? For sure, you can go online to any cloud provider as long as you have your credit card ready. But is the service provider the best fit for your requirements? Do you have a backup plan if you are not satisfied with your service provider? Can you easily switch among your service providers to minimize cost or maximize flexibility? If you are not sure, you may then need something like a cloud broker.


Posted in Cloud Computing | Tagged , , , | 1 Response

    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.