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. Read more... (543 words, estimated 2:10 mins reading time)
Performance monitoring is a critical aspect of vSphere administration. This article introduces you the basic concepts and terminologies in vSphere performance management, for example, performance counters, performance metrics, real time vs historical statistics, etc. Much of the content is based on my book VMware VI and vSphere SDK by Prentice Hall.
Once you understand these basics, the related tools and APIs should be relatively easy. If you are already familiar with vSphere Client performance monitoring or esxtop, they help as well.
Performance Counter
A performance counter is a unit of information that can be collected about a managed entity. PerfCounterInfo data object, shown in Figure 1, represents a performance counter. The property key is an integer that uniquely identifies a performance counter, like a primary key of a table in SQL database, and nothing more. There is no guarantee for a performance counter to have a fixed number. In fact, the same performance counter can have different values in ESX and VirtualCenter. Even for the same type of server, the number could change from version to version. Do not use it outside the context of the server you connect to.

Figure 1 PerfCounterInfo data object
The performance counter can be represented by the following dotted string notation: Read more... (1520 words, 2 images, estimated 6:05 mins reading time)
Just got the following email from Andrew Kutz (@sakutz) who wrote the famous VMware Infrastructure (VI) plug-ins whitepaper and created several other great projects like VMM.
David Marshall, Dave McCrory and I, as well as everyone else at Hyper9, are extraordinarily proud to announce SimDK – a VMware vSphere4 simulator which provides vSphere4 API-compatibility for official vSphere4 clients and other applications built using the vSphere4 SDK.. SimDK is an open source project available at http://simdk.sourceforge.net/. You can read more about this exciting announcement at http://akutz.wordpress.com/2010/03/09/simdk. Read more... (191 words, estimated 46 secs reading time)
In vSphere Java API 2.0, I wrote a lightweight caching framework. It’s still experimental but has a great potential to greatly simplify your development work. Commercial companies already use it in their products.
The motivation behind this framework is simple – instead of keep polling the changes from the server side, you keep a local cache that is made as fresh as possible. The View in the vSphere Perl toolkit is one way to do. It caches all properties of a managed object despite the fact that you don’t need that many at all.
The caching framework in vSphere Java API takes another approach. You tells it what managed objects and what properties you want to be cached. After that, the caching framework does its best to read the properties and keep them as fresh as possible.
Architecturally the caching framework is totally separated from the core of the API. You can take it away without any impact on the rest of the API. This is quite different from other toolkit.
Have enough introduction? Let’s take a look at sample code: Read more... (489 words, estimated 1:57 mins reading time)
In my previous blogs, I have introduced the vSphere API object model, vSphere Java API architecture. I assume you’ve run through the 5 minute Getting Started Tutorials with HelloWorld sample.
Now, let’s take a look on how to use the API in general.
1. Always starts with a ServiceInstance with URL/username/password, or URL/sessionID. For example,
ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true);
2. From the ServiceInstance object, you can: Read more... (371 words, estimated 1:29 mins reading time)
When I start to use a new API/SDK, I always look for the object model diagram before digging into the API Reference. With that, I can have a good overview of the API, from the concepts to the structure. This can save a lot of time.
Unfortunately, we don’t find such a object model diagram in any official document. The following is the UML diagram from my book VMware VI and vSphere SDK. Read more... (340 words, 2 images, estimated 1:22 mins reading time)
While browsing the project home of VI Java API, I found a link to a great tool contributed by pitchcat. It is a standalone Java application that shows managed objects and data objects in a tree hierarchy, and all the methods attached to a managed object.
I highly recommend it to all the VI Java API developers. Why? Although you can get similar information from MOB, vijava browser gives you an overview of all the managed objects and clear paths to any managed objects or data objects. Read more... (129 words, 2 images, estimated 31 secs reading time)
During last Friday VMware beer bash, I bumped into Carter Shanklin. He told me he’s ready show off how his Onyx project can help Java developers using VI Java API at Partner Exchange next week in Las Vegas. If you will be there, be sure to attend his session TEXIBP1007 – also known as “Getting Stoned with ‘Project Onyx’” on Thursday at 11:30. Read more... (180 words, estimated 43 secs reading time)
In my previous blogs, I talked about session management for scalability and best practices (#9). In this one, I am going to drill down to the bottom.
To your surprises, there are two types of sessions involved in vSphere SDK:
- HTTP Session. It’s used to identify a client and tracked by the cookie in HTTP header. Once you login the server, all the successive requests have to carry the cookie header similar as follows
vmware_soap_session=”5229c547-1342-47d1-e830-223d99a47fba” Read more... (434 words, estimated 1:44 mins reading time)
- User Session. It’s used to identify a login session of a particular user. You can use SessionManager to find out more the details of the current user and other login users from the UserSession data object. The key in the UserSession is in the same format as the HTTP session, but you should never confuse them, or use them interchangeably.
In yesterday’s blog, I talked about a little known secret of vSphere MOB – the invisible embedded XML in the HTML pages. To take advantage of the secret, I created a client side REST API which was shipped in VI Java API 2.0. Read more... (937 words, 2 images, estimated 3:45 mins reading time)
Recent Comments