What is the difference between vmdk alignment and realignment and why should you care?
The alignment of vmdk's is the big white (or pink if you prefer) elephant in the room from a performance standpoint. It is often ignored by many customers and misalignment can lead to as much as a 30% degradation in performance!! To their credit, both NetApp and EMC have recognized this and and released documentation to address the issue. Here are links to VMware & NetApp papers on the subject. EMC documents H2197, H2529 & H5536 on PowerLink also provide information on the subject. EVERY storage vendor has this problem; EMC and NetApp are the only two I know of that have spoken about it. If aren't aligning/realigning your virtual machines as part of standard best practices, you should be!
What is the difference between alignment and realignment?
As pointed out to me by Duncan Eppping in a Twitter conversation, there is a big difference between alignment and realignment. Alignment happens when the partitions are created but before the OS is installed. Let's be honest, it is a pain in the butt and many don't learn about alignment issues until they start to have problems. Because it is a pain, many choose realignment to remedy the problem. Realignment is the concept of using tools (vOptimizer and NetApp's mbrscan/mbalign come to mind) to align an existing vmdk that is misaligned. This process requires taking the machine offline and then rewriting the entire vmdk in an aligned format. I'm speaking about realignment in this article.
Are all virtual machine operating systems affected?
NO - Windows 2003 and earlier are misaligned by default but Microsoft changed the alignment of Windows 2008 so it is now aligned by default. Be careful though, Windows Dynamic Disks, Cirtix Servers, and many other special cases often won't work. See my article on the NetApp tools for more information. I'm not an expert on the Linux vm's but if you have experience, please leave a comment! Lastly, if you align your template, all deployments from that template will also be aligned. This is really nice IF you remember to align your template before installation of the OS and before you deploy all your machines!
What does this have to do with ESXi?
Both vOptimizer and NetApp mbrscan/mbralign utilize the service console so ESX works just fine. Due to the lack of a service console, ESXi is a different story. With NFS datastores, you can mount a Linux host to the datastore and perform the alignments using the NetApp mbrscan/mbralign. This process is documented by Nick Triantos here. I'm not sure if you can use vOptmizer in this way. VMFS is another story. Currently, there doesn't appear to be a clear method to realign vmdk's. No service console to run the utility and no way to access the VMFS outside of ESXi. What do you do if your storage vendor doesn't support NFS? What would you do if your storage vendor is VMFS (LUN based) only? You have problems my friend.
I did a poll on Twitter yesterday and the results confirmed the same findings as my customer base. Many still use win2k03 based servers and most P2V's are Windows 2003 server and earlier. In addition, ESXi is trending to the market faster than windows 2008 virtual machines yet many have no idea about the concept of vmdk alignment/realignment.
What are the work-arounds?
- Create a linux host and attach it to an NFS datastore and run NetApp mbrscan/align from there (not sure if that will work on vOptimizer)
- Set up a single ESX host to perform the alignments on VMFS datastores
- Align your Windows 2003 template and deploy aligned machines on VMFS and P2V all machines to NFS
When/How could this be fixed (I'm guessing here, I have no inside knowledge of any vendor products)?
- ESXi includes the ability to detect and realign vmdk's
- Storage Vendors include the ability to detect and realign vmdk's
- Incoming P2V's of older OS's are aligned in transit
- Windows Server 2008 Server becomes the standard
Bottom Line - Can you get around the issue? Yes you can. Is it a pain? Yes it is. Until this is fixed I will continue to recommend ESXi with NFS environments but I will continue to resist ESXi with VMFS unless the customer fully understands the ramifications of this issue. I look forward to using ESXi as my standard and we get closer and closer everyday but we also need to be careful.