As most of you know the mbrscan/mbralign utilities NetApp provides as part of the NetApp Host Utilities Kit for ESX server 5.1 require an ESX console. For those with ESXi, and depending on the protocol deployed, you may or may not be able to leverage these tools.
In particular, for those who are running NFS, there is a simple workaround which I will describe below.
Requirements:
In order to align partitions you will need the following:
1) mbrscan/mbralign
2) Linux Guest
Steps:
1) Export and Mount the NFS volume/datastore directly onto the Linux Guest
# mkdir /nfs_datastore
# mount IP_adress_of_NFS_Server:/vol/nfs_datastore /nfs_datastore
2) Download mbrscan/mbraling into some directory in the Linux Guest. I use /sbin but /usr/sbin is probably a better choice for non-OS binaries/utilities.
Mbrscan
Before you proceed with this step, you will need to make sure that either, your VMs have VMware Snapshots, or they are powered-off, otherwise mbrscan will fail.
Single VM
If you'd like to scan a single VM run:
# /usr/sbin/mbrscan <path to the flat.vmdk>
Multiple VMs
If you have a lot of VMs in the Datastore use "find" which will scan the entire datastore and will report the alignment status of all the vmkds for each VM present.
# find /nfs_datastore -name "*-flat.vmdk" -maxdepth 3 -exec /usr/sbin/mbrscan {}";"
Mbralign
Upon detecting which VMs, or rather vmdks, require partition alignment, you can use mbralign to address the issue.
Make sure you have enough space in the datastore to accommodate another copy of the target flat.vmdk and .vmdk files, because prior to partition alignment mbralign will make backup copies of these files. Additionally, the target VM needs to be powered off and you can't have a VMware snapshot associated with it during this process.
However, if you do happen to have a VMware snapshot, the tool is intelligent enough to detect it and it will throw an error:
root@rhel1 WinXp2]# /sbin/mbralign WinXp2-flat.vmdk
Error: WinXp2.vmdk has a snapshot (WinXp2-000001.vmdk). All snapshots must be removed before using this tool.
Unlike mbrscan, mbralign, works on a single vmdk at a time so:
# /usr/sbin/mbralign <path to the flat.vmdk>
After the process completes, power-up your vm and make sure everything is functioning properly. Then, make sure to remove the backup files.
Unmount
Once everything is functioning properly, remember to unmount the NFS datastore from the Linux Guest.
# cd /
# umount /nfs_datastore
Pretty simple stuff.


Hi there,
do you think it is important to align logical volumes too?
For example, suppose I've got these disks:
/dev/sda -> /dev/sda1 -> /boot
/dev/sdb -> /dev/sdb1 -> vgsystem (with many LV inside)
/dev/sdc -> /dev/sdc1 -> vgdata (with many LV inside)
I can align correctly the beginning of all partitions, but what's about the alignment of LVs? Do I have to check this too? But it can be very difficult, because LVs can be distribuited over many PVs inside the same VG! And, by the way, I suppose that the physical extend size - which is at least 1K and a power of 2 - can "align" the data automatically, supposing that the PV partitions ar correctly aligned.
Thanks for your articles!
Manu
Posted by: Manu | October 29, 2009 at 03:01 AM