|
Page 1 of 4
Importance of Disk Alignment in VMware
Some of you might already be familiar with the tremendous I/O improvements that come from a RAID disk set that has the correct alignment. But how does this translate into the virtual world and virtual disks? Well, as with many things in the virtual world, what is good practice in the physical world also makes for good practice in the virtual world.
For anyone who is not familiar with the term disk alignment, it’s an issue that has traditionally plagued physical machines (both Linux and Windows) using RAID volumes (software and hardware.) The effects are staggering, a correctly aligned disks can yield anywhere between a 10% - 40% increase in performance over a non aligned RAID volume. Just in case you missed that, I said 10% - 40% - wow!
So you might be wondering if this holds true within a virtual machine also. Well, this is a complicated question to answer because most virtual machines running on an ESX server, whether using raw disk mappings (RDM) or more traditional virtual machine disk files (VMDK) don’t use RAID. Most people create one or two VMDK’s, one for the boot and one for the data volumes, for each of their virtual machines. At first glance, you may think disk alignment within a virtual machine is not necessary, but guess again. Even though most virtual machines do not use RAID within the guest operating system, the VMDK files used by the virtual machines sit on LUNs which do use RAID. Therefore, disk alignment within your virtual machine is critical.
There is a lot of incorrect information surrounding this topic because most people fail to realize the VMDK is running from a RAID blackened LUN. So whether you’re talking about the boot or data volume, (in a virtual machine running from a LUN) you should always align the disk.
I've borrowed some text from VMware's partition alignment guide to help illustrate the point further.
"In a SAN environment, the smallest hardware unit used by a SAN storage array to build a LUN out of multiple physical disks is a called a chunk or a stripe. To optimize I/O, chunks are usually much larger than sectors. Thus a SCSI I/O request that intends to read a sector in reality reads one chunk.
On top of this, in a Windows environment NTFS is formatted in blocks ranging from 1MB to 8MB. The file system used by the guest operating system optimizes I/O by grouping sectors into so-called clusters (allocation units).
Figure 1 shows that an unaligned structure may cause many additional I/O operations when only one cluster is ready by the guest operating system."

So as you can see, alignment within the VMDK can lead to a performance hit if its not aligned.
I also want to dispel the notion that aligning the boot volume within a virtual machine is pointless. True, most good system administrators will move I/O intensive applications to a data drive, but if the application is truly I/O intensive, should it even be virtualized in the first place? Working under that assumption, for the applications and systems you have virtualized, why not give them the best possible performance? Deploying a virtual machine from a template that has already been aligned requires no additional work and that virtual machine will forever more benefit from the affects of a correctly aligned volume.
I should however point out that the 10% - 40% performance increase in the physical world doesn’t translate verbatim to the virtual world. If you’ve been running virtual machines for any length of time, you have probably noticed less I/O throughput on your virtual machine as compared to that of a physical machine. Therefore it’s safe to assume the same for the virtual machine, but don’t think for a moment that your time is wasted aligning your volumes within a virtual machine. VMware reports throughput can increase by as much as 62% (averaging about 12%) with a latency decreases of up to 33% (averaging about 10%) with proper disk alignement. That’s a nice little performance boost and one that most of us could use.
|