Align Virtual Machine Disks with NetApp’s MBR Tools

In most environments I’ve been in, disk alignment is something no one knew about or no one cared about. There are still plenty of Windows Server 2003 VMs out in the wild and I’m sure few people realize the impact these misaligned disks have on their storage arrays. There are a few different ways to fix this issue (which are listed in the link above) as well as using VMware Converter which has the option to optimize the partition layout during conversion. For this post we’ll focus on using NetApp’s MBR Tools and mbralign.

This documentation assumes you have the NetApp Virtual Storage Console (VSC) plugin connected to your vCenter instance. If you have an active NetApp account you can download it directly from the NetApp website.

1. Login to the vSphere client
2. Click the Home button in the top-left corner
step2
3. Click on “NetApp” under Solutions and Applications
step3
4. Click on the “Tools” link on the left side under “Monitoring and Host Configuration”
step4
5. Click the “Download” button for your version of ESX(i) and the location on your system to save it to
step5
6. Enable SSH on the ESXi host that currently hosts the VM to be aligned

a. Under “Configuration” tab for the host, click on “Security Profile” under the “Software” section. Click on “Properties” towards the top right corner. Scroll to “SSH” and click on “Options” then click “Start”

7. Click on “Storage” under “Configuration” for that ESXi host and locate a datastore (an NFS volume for this documentation) to upload the MBR Tools to.

a. Right click and choose browse datastore. Then Click the Upload button and upload the .TGZ
step7a

8. Open your SSH client (Putty) and connect to the ESXi host
9. Type the following commands

a. cd /vmfs/volumes
b. ls
step9b
c. Locate the datastore you uploaded the “mbrtools_esxi.tgz” to (ISO_Templates for this writing) and change directory to that datastore
d. cd ISO_Templates

10. Run the following command (Note the directory will show the ID of the volume, not the name of the volume)

a. tar xvzf mbrtools_esxi.tgz
step10a

11. Run the following command replacing the ID of the datastore with the ID of the datastore you’re using

a. cp -r /vmfs/volumes/26ee88d8-9323fd52/opt/ontap /opt/ontap

12. Change directory to the datastore hosting the VM that needs alignment

a. Cd /vmfs/volumes
b. Ls
c. Cd /vmfs/volumes/volumename
d. Ls (to find the folder name)
e. Cd VM_FolderName
step12e

13. Locate the VMName-flat.vmdk file and run the following command

a. /opt/ontap/mbrscan Test-Alignment-flat.vmdk (You should see “aligned:No” at the end)
step13a

14. Before running the alignment, verify these items FIRST!

a. THERE IS AT LEAST AS MUCH SPACE FREE IN THE DATASTORE AS THE SIZE OF THE DISK
i. If the disk is 50GB, there needs to be 50GB free
b. THERE CAN BE NO SNAPSHOTS OF THE VM IN VCENTER (Delete any snapshots that exist first)
c. THE VM MUST BE POWERED OFF PRIOR TO RUNNING THIS.

15. After all that has been verified, run the following command replacing the VM disk name

a. /opt/ontap/mbralign Test-Alignment-flat.vmdk
b. Press “y” to confirm there are no snapshots

16. Run the mbrscan command from step 13 to verify that disk is aligned
step16
17. Power on the VM and login. You will likely receive a message about installing new devices and system settings changes. Click Yes to reboot the VM.
18. Once you have verified functionality for the VM, remove the mbralign backup files created in the datastore with the following command

a. “rm *-mbralign-backup”
step18a

 

The time for alignment varies based on the size of the disk. This process is fairly straightforward and quick to run. When you have a VM with multiple disks or just a lot of VMs to complete it is often times faster to use VMware Converter.

Advertisements
Align Virtual Machine Disks with NetApp’s MBR Tools

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s