Wednesday, February 29, 2012

How to check I/O speeds

While working on a VMware ESX image, I came across this situation that it was working really well when hosted on Datastore1. However, if I moved it to Datastore2, the response of the image became very poor.
Since the VMware ESX machine was same, it was abundantly clear there was something wrong with Datastore2. Unfortunately VMware ESX doesn't seem to complaint if the I/O speeds degrade - atleast I am not aware of this. So the only way to find out was by testing the I/O speeds seen by the VMware Image.
The tool I used is a pretty familiar one in Linux world - dd. Here's what you do:

Image is on Datastore1
Step 1: Login to your linux machine
Step 2: Run this command on shell `dd if=/dev/zero of=/dev/null& pid=$!`
Step 3: Run this command after few seconds `kill -USR1 $pid; sleep 1; kill $pid`

You'll see an output like this below. Pay attention to the last line.

[root@mylinux ~]# dd if=/dev/zero of=/dev/null& pid=$!
[1] 10055
[root@mylinux ~]# kill -USR1 $pid; sleep 1; kill $pid
23469330+0 records in
23469329+0 records out
12016296448 bytes (12 GB) copied, 11.711 s, 1.0 GB/s

Repeat the above steps on Datastore2.

[root@mylinux ~]# dd if=/dev/zero of=/dev/null& pid=$!
[1] 4430
[root@mylinux ~]# kill -USR1 $pid; sleep 1; kill $pid
11572320+0 records in
11572319+0 records out
5925027328 bytes (5.9 GB) copied, 10.962 seconds, 541 MB/s

As you can see the I/O speed on Datastore2 is 541 MB/s against 1GB/s on Datastore1. Hence I was seeing degraded performance on Datastore2.

Labels: , , ,

Thursday, February 23, 2012

VMware ESX Clones and Windows SID.

I had made a single installation of Windows Server 2008 R2 and saved this as a master clone - using this master clone I made no.of other clones for my use. Turns out if you don't chose the option to customize the new virtual machine (which is the default option :-( ) , the new virtual machine will bear the same SID (security identifier) as the main cloned image.

This is still OK (perhaps not) if you plan to use these cloned VM's in different environments. However, if you plan to create a Active Directory Domain and add these VM's on the same domain, authentication gets messed up seriously. Worst part is that when you add machines to domain, it won't complaint, only when you chose to use domain accounts to auth (like logging into Member Server using Domain account) it will spit out error on event viewer logs.
It took lot of google time to realize that domain account on member server was failing because of duplicate SID which was because I was using clones of the same image.

Lessons:
1) If you ever take clones of a VM, ensure you chose to customize the new virtual machine, by choosing the option "Customize using the Customization Wizard".
2) If you already have clones now, you can accomplish #1 above using VMware Convertor tool, by using the option "Configure machine". This will force SID change on the VM amongst other things.

Labels: , ,