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 socalled 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.
Figure 2 shows I/O improvements on a properly aligned Windows NTFS volume in a VMDK on a SAN LUN.
To check that your existing partitions are aligned, issue the command:
The output is similar to:
Device boot Start End Blocks Id System
/dev/sdj1 128 167766794 83883333+ fb Unknown
Aligned partitions start at 128. If the Start value is 63 (the default), the partition is not aligned.
Let summarize it in a few bullet points on one page:
- Unaligned volumes result in track crossing and additional I/O penalties in the form of latency and throughput which may or may not be noticeable in your environment (it depends)
- To verify whether or not your VMFS volumes are aligned, run the fdisk -lu command at the console
- Aligned VMFS volumes will show a start value of 128.
- Non aligned volumes will show a start value of 63 (the default)
- VMFS volumes created with the Virtual Infrastructure Client are automatically aligned
- VMFS volumes can also be aligned by following a series of fdisk commands which will destroy data on the volume.
- Due to the destructive nature of the alignment procedures, alignment is always performed before data is placed on the volume
- Alignment in Linux guests is performed using an almost identical series of fdisk commands in step 4 above.
- Alignment in Windows guests is performed using diskpart.exe
- Although guest alignment is also data destructive, guest alignment can be performed after the guest OS is installed because the document recommends that alignment of the OS partition is unnecessary; only align the data partitions before data is placed on them
- VMFS block size only determines maximum file size on the VMFS volume. It doesn’t play a performance role
Alignment is most often going to be labor intensive and thus will have diminishing returns. This will especially be true if your environment has already been built and you need to align after the fact. Environments in the planning stages and not yet built will be among the best candidates for alignment right out of the gate. Whatever stage you are at, updating guest VM templates with alignment wouldn’t be a bad idea. Alignment of one image will pay dividends, whether noticeable or not, over and over as that template is deployed throughout the infrastructure.