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
3. Click on “NetApp” under Solutions and Applications
4. Click on the “Tools” link on the left side under “Monitoring and Host Configuration”
5. Click the “Download” button for your version of ESX(i) and the location on your system to save it to
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.
8. Open your SSH client (Putty) and connect to the ESXi host
9. Type the following commands
10. Run the following command (Note the directory will show the ID of the volume, not the name of the volume)
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
13. Locate the VMName-flat.vmdk file and run the following command
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
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
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.