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

VMware PEX 2011 – Day Three

February 10th, 2011 No comments

Today’s meeting started by Dale Irvin who told several jokes before he introduced Carl Eschenbach, co-president of customer operations. Karl reiterated what he said before to partners, “you are not extension of our salesforce, you are our salesforce.” He reviewed four quarters in 2010 with breakdown numbers, and thanked partners for growing VMware business.

Among the top 15 partners who won awards are F5 as technology innovator of the year; and Siemens as vertical application partner of the year. Representatives from these companies got on stage with Karl for a photo. In 2010, partners got $300K opportunity on every $20K VMware sales, an increase from 11 times year before to 15 times.

Moving on, Karl went over the awards VMware got, from people to channel programs and products. He then showed a chart with four squares, on which companies like VMware, Microsoft, Citrix and other technology vendors are listed. VMware is the only company in the top right square with technical leadership. “We’re almost out of chart. They kept us in.” Karl joked.

In the second half,

Categories: News & Events Tags: ,

VMware PEX 2011 – Day Two

February 9th, 2011 No comments

This is the official day one of the conference. The most important part is of course the keynote in the moring. The following is based on my notes therefore may not accurate.

VMware CEO Paul Maritz kicked it off by reiterating the huge success last year with $2.9B revenue as 41% year-over-year increase, and $45B ecosystem around VMware technologies. He gave a big thank-you to all the partners for that.

Paul moved on by asking, “what customer want?” His answers is “enable greater business agility while becoming more efficient.” He emphasized that infrastructure is to support applications, and discussed the evolution from existing enterprise app, to new enterprise app, and to SaaS. He concluded his keynote saying “working down the road ahead can be better.”

After Paul came on stage Dale Irvin, who is a “professional summarizer” (a specialized comedic speaker?). He recapped what Paul just talked about and made small jokes. He did pretty much the same for each of the following keynote speakers therefore one “don’t need to take note and just listen to him.” To paraphrase him, you don’t need to attend PEX but read my blog. :-)

Categories: News & Events Tags: ,

VMware PEX 2011 – Day One

February 8th, 2011 No comments

Today is the first day of VMware Partner Exchange 2011 in Orlando. It’s again at DisneyWorld as two years ago. Unlike last time, the conference hotel Coronado is too far for me to walk over. As a result, I have to take bus back and forth. Other than this small inconvenience, DisneyWorld is really a pleasant place for conference.

Categories: News & Events Tags: ,

Best Practice vs Never Practice

February 6th, 2011 No comments

Today I read a commentary of latest MSDN magazine by David Platt who is famous for his book why software sucks. In his commentary titled Never, Never Land, he compared our software development to the medical industry on malpractices, and drew the following conclusion:

Certain occurrences are never, never, acceptable. We need to define these events, publicize them and educate developers about what they are and how to avoid them.

In IT world, we’ve heard many best practices. I have personally contributed many of them in using VMware vSphere APIscloud application development, and writing sample code. For consistency with best practices, I call these never land “never practices.” If you search the Internet with “never practice” today, you won’t get any but this post at the top. But we do need more never practices. In the article, David offered one general never: never lose users’ data, and he asked readers to share more.

Getting ESX and ESXi Memory Info

February 2nd, 2011 9 comments

With a vSphere Client, you can easily check the memory information of a host, either ESX or ESXi. To get that, you click on a host from the inventory tree, and then configuration tab. From the left side Hardware section of the configuration page, you click Memory and see a pane displaying the memory info as follows:

Note that if you have chosen a ESXi host, you won’t see the Service Console part because there is no console OS any more in ESXi. BTW, VMware wants you to migrate from ESX to ESXi and here is a link with helps.

This seemingly easy information is actually not easy to get. At first glance, it should be in the config property of HostSystem (managed object representing an ESX or ESXi). The config property has a sub property called systemResources, typed as HostSystemResourceInfo. But you will get null for the systemResources property most, if not all, of the time, as reported in VI Java API forum.

Interestingly enough, HostSystem has a systemResources property in peer to the config property as well. Luckily, it’s not null so you can dig down for something. Still, with 3 sub properties of complex types included, how to get the memory from the data object?

Here are the steps to collect and calculate the numbers:

Categories: vSphere API Tags: , , ,

How I Customized My WordPress Blog

February 1st, 2011 No comments

At the beginning of this year, I changed the theme of my WordPress based blog. Upon checking the site, several folks said it looked familiar and like facebook.com. In fact, when I searched for a new theme, I did use facebook as a keyword because I like the clean and simple look and feel. As you can check at the bottom of the blog, the new theme is called Crybook by Themetation and Crynobone, which you can hardly link the name with facebook except the word “book.”

The issues

After switching to Crybook, I really liked it but also found several minor issues with the theme. First of all, the “read more” link is not placed right in the overview of an article. Instead, it’s placed at its bottom. As a result, a reader may be confused where to read next. Secondly, it puts a line at the bottom at an article overview, and two links below the line. At a first impression, the two links seem more related to the next article than to the current one. Thirdly, it does not have the tags explicitly listed with the article as I expected. Tags are important to navigate through articles.

So I decided to customize the theme for my own preference which I hope leads to better reader experience.

How to Change VMX Programmatically?

January 31st, 2011 7 comments

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.

How to Differentiate Folders in vSphere

January 28th, 2011 4 comments

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:

Free ESXi and API/CLI support

January 27th, 2011 8 comments

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.

Categories: vSphere API Tags: , , , ,

Book Review: 6 Musts of Intelligent System Automation

January 26th, 2011 1 comment

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

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

January 25th, 2011 No comments

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: