Storage Alignment and VMFS Block Sizes


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:

 

fdisk -lu

 

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:

  1. 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)
  2. To verify whether or not your VMFS volumes are aligned, run the fdisk -lu command at the console
    1. Aligned VMFS volumes will show a start value of 128.
    2. Non aligned volumes will show a start value of 63 (the default)
  3. VMFS volumes created with the Virtual Infrastructure Client are automatically aligned
  4. VMFS volumes can also be aligned by following a series of fdisk commands which will destroy data on the volume.
  5. Due to the destructive nature of the alignment procedures, alignment is always performed before data is placed on the volume
  6. Alignment in Linux guests is performed using an almost identical series of fdisk commands in step 4 above.
  7. Alignment in Windows guests is performed using diskpart.exe
  8. 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
  9. 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.

 

Original posts here and here

Advertisements

About PiroNet

Didier Pironet is an independent blogger and freelancer with +15 years of IT industry experience. Didier is also a former VMware inc. employee where he specialised in Datacenter and Cloud Infrastructure products as well as Infrastructure, Operations and IT Business Management products. Didier is passionate about technologies and he is found to be a creative and a visionary thinker, expressing with passion and excitement, hopefully inspiring and enrolling people to innovation and change.
This entry was posted in Uncategorized. Bookmark the permalink.

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