Pages

Tuesday, March 15, 2011

MBRAlign of Vmware on IBM N Series (Netapp)

We use a IBM N-Series array (read as: Netapp without the useful software yet comes with painful IBM support) and are experiencing horrific performance. As part of the blame game IBM pointed the finger at a few Vmware Virtual Machines that where misaligned then hung up. Even if the there are no misaligned Virtual Machines on a particular filer the speed doesn't improve nor does non Vmware connected servers. Nor does an aligned Virtual Machine run the tests any better then before we aligned it. But aligning is a good thing and as such heres some of the notes on the process.

First we need the MBRalign tools. You can download them from your vCenter client If you installed  IBM N series VSC on your vCenter. If you didn't start installing. This will add a plugin to your VCenter Client. Once thats installed, good luck, select a ESX host and there should be a "IBM N Series" Tab. From there select tools and download.
VCenter IBM N Series Tab
That download should be a "mbrtools.tar.gz" file that we need to copy to the ESXthat will be running the alignment and has access to the VM datastores. I use WinSCP to copy the file to the ESX host. You should also open the "mbrtools.tar.gz" file on your work station to view the readme and pdf how-to stored in it.

Note: Its normally necessary to SSH into a ESX server so I always create a local account to login remotely with and then su up to root. If you haven't done this it is really worth your time to do so. That same non root account is also useful to login with WinSCP to move files on and off the host.

Once the "mbrtools.tar.gz" file is on the ESX host SSH to that
ESX host create the folder you want the file extracted to. In my case my local accounts home directory is fine. Then move the "mbrtools.tar.gz" file to the new directory and extract the contents.

mkdir /home/esxshell/mbrtools
mv /home/esxshell/mbrtools.tar.gz  /home/esxshell/mbrtools/mbrtools.tar.gz
cd /home/esxshell/mbrtools
tar -xzf mbrtools.tar.gz
Now we're ready to use ./mbrscan and ./mbralign but before you do make sure of the following.

  • The VM is powered off.
  • There are no snapshots
  • After mbralign you test if the alignment worked before deleting the *mbralign-backup files.

Find all Misaligned VMDK's
./mbrscan --all | grep 'aligned:No'

Command to Align a VMDK
./mbralign --thereAreNoVmSnapshots  /vmfs/volumes/......../VM.vmdk

If your storage is an NFS Share you can also use "--sparse" but that option is only designed for NetApp NFS based datastores.

Find all the Backup VMDK Files left over from the mbr alignment 
find / -name '*mbralign-backup' 2> list.txt

These files can be deleted if the alignment went successfully and the VM is bootable and all volumes mounted. Test before you remove these.

Output from an successful alignment.

[root@vmhost mbrtools]# ./mbralign --thereAreNoVmSnapshots  --sparse /vmfs/volumes
 Part    Type          old LBA    New Start LBA      New End LBA     Length in KB
   P1      07               63               64         61464691         30732313
   P2      07         61464690         61464704        286455029        112495162
Creating a backup of /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2.vmdk
Creating a backup of /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2-flat.vmdk
Creating a copy the Master Boot Record
Working on partition P1 (2): Starting to migrate blocks from 32256 to 32768.
12801 read ops in 5 sec.  21.45% read (17.68 mB/s).  16.56% written (0.15 mB/s)
Working on P2 (3): Starting to migrate blocks from 31469921280 to 31469928448.
12801 read ops in 7 sec.  99.94% read (13.11 mB/s).  50.14% written (13.11 mB/s)
Working on space not in any partition: Starting to migrate blocks.
100.00 percent complete.  50.18 percent written. 71365848KB saved.                
Making adjustments to /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2-flat.vmdk.
Adjusting the descriptor file.
[root@vmhost mbrtools]#

If the Alignment was Unsuccessful
You can rerun the same "./mbralign --thereAreNoVmSnapshots  /vmfs/volumes/......../VM.vmdk" command if you haven't yet deleted the '*mbralign-backup' file and it will prompt you if you want to restore the backed up version. Enter [y/n] to answer
[root@vmhost mbrtools]#  ./mbralign --thereAreNoVmSnapshots  --sparse /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1-flat.vmdk
Error: A backup file named /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1-flat.vmdk-mbralign-backup was found.  This may be from a failed realign.
      Please remove or rename all files ending in -mbralign-backup.
Shall I restore /vmfs/volumes/46a39716-c29e1eb0/devdb2/devdb2_1.vmdk from the backup I made?
Alignment of Linux VMs
Unlike the Windows Virtual Machines you'll have to modify it before the VM will boot. The "howto.pdf" inside the "mbrtools.tar.gz" file has directions on how to fix this.

No comments:

Post a Comment

Please leave a comment; someone, anyone!