One of the first things that Netapp Support ask you if you are experiencing any performance issues is: Are all your vm’s and data aligned correctly. Why is it important to have your alignement corrected, Simple, otherwise the system will be working much harder than what it has to for it to be able to read and write data blocks. For a great explanation on alignment, head on over to Duncan’s website at Yellow-Bricks.com. Also check out this Technical Report 3747 from Netapp in regards to Best Practices for File System Alignement in Virtual Environments.
Netapp Mbralign – How to indentify Misaligned VM’s
First up, we need to identify which vm’s are misaligned. For this, the quickest way is to use Netapp Virtual Storage Console VSC 4.x. Virtual Storage Console is a plug-in into your vCenter Server. With Virtual Storage Console we can scan our datastores and report back on which VM’s require alignment.
1. Open your vCenter server and browse to Solutions and Applications – Netapp. Click on the Optimization and Migration tab on the left hand side. Select the datastore that you wish to scan.
2. Click Scan Selected and the Scanner Status will change from IDLE to Running.
3. Once the Scanner Status returns to IDLE, click on the Virtual Machine Alignment options on the left hand side and click on the Misaligned Folder. As you can see in my screenshot, VSC has identified 2 virtual machines that are misaligned, 1 Windows 2003 Server and 1 Red Hat Enterprise Linux Server.
Netapp Mbralign – How to Install Mbralign
1. The Mbralign tool is downloaded from the VSC. Within VSC click on Monitoring and Host Configuration – Tools. Click Download for the ESX or ESXi host version in your environment. Save the file to your local hard drive.
2. Enable SSH on your host by selecting your host, clicking on the configuration tab – Security Profile. Select SSH and click the Options button to start the service.
3. Use WinSCP to connect to your ESX or ESXi host and upload the mbrtools_esxi.tgz file to the root directory.
4. Now use Putty to connect to your ESX or ESXi host. From the root directory type in untar -zxf mbrtools_esxi.tgz. The files get extracted to /opt/ontap.
Netapp Mbralign – How to Align Windows Virtual Machines
1. As you can see in my vCenter Server I have 2 Virtual Machines named Rhel5-Web2 and Windows2003-Web1. In this demo we will look at aligning our Windows2003-Web1 vm.
2. SSH into your ESX or ESXi host and change directory to /vmfs/volumes/YOU-DATASTORE-NAME/YOUR-VM-FOLDER and type ls
3. Lets first double check that your virtual machine is actually misaligned. We can run mbrscan to check this against the *-flat.vmdk file. Type in /opt/ontap/mbrscan Windows2003-Web1-flat.vmdk. As you can see in this screen shot Aligned=No.
4. Let’s run the mbrscan process now. Just a quick note, that you will need double the size of the vm in your datastore to successfully run this process. For example, if your vm is 50GB, you will need another 50GB of free space in the datastore. There also can’t be any VMware snapshots on the vm, if you have snapshots you must remove them before running mbralign and lastly, the virtual machine must be powered off during the process. At the CLI type in /opt/ontap/mbralign Windows2003-Web1-flat.vmdk. The alignment process begins.
5. Once the alignment process has stopped, you can run /opt/ontap/mbrscan Windwos2003-Web1-flat.vmdk again and you will see the virtual machine is now correctly aligned.
Netapp Mbralign – How to Align Linux Virtual Machines
After aligning as you will see in the video you will be re-installing Grub. We need to tell grub to boot from the partition that contains /boot/grub/stage1. To verify this run find /boot/grub/stage1
All the tutorials included on this site are performed in a lab environment to simulate a real world production scenario. As everything is done to provide the most accurate steps to date, we take no responsibility if you implement any of these steps in a production environment.