This is just a quick post about how to check and manually set the LUN alignment offset on the NetApp Platform. Traditionally you can only do this using the wizards in the VSC Console but in some cases you may want to create a LUN with a specific offset without using the wizard which forces you to migrate VM’s onto the newly created LUN at the time of creation.
For me this was especially useful when attempting to fix alignment issues on Linux VM’s which use LVM and are not correctly identified as being mis-aligned in the VSC tool.
Identifying the LUN offset
The following commands will allow you to see the offset of a LUN or manually set the offset if you are trying to manually overcome disk alignment issues.
If a LUN has a manually set offset (or a custom offset defined by the use of the VMWare Plugin) it will show up in the output of the following command:
netapp> lun show -v /path/to/lun
The output will look like:
netapp> lun show -v /vol/SOME_VOLUME/some_offset_lun
/vol/SOME_VOLUME/some_offset_lun 500.3g (537201213440) (r/w, online, mapped)
Serial#: W-XqR4os9oY1
Share: none
Space Reservation: disabled
Multiprotocol Type: vmware
**Prefix Size: 3.5k (3584)**
Suffix Size: 0 (0)
Extent Boundary: 0 (0)
Maps: badass_esx_farm=41
If a LUN does not have a custom offset, meaning the offset is defined by one of the built in OS Types, it will show up like this:
netapp> lun show -v /vol/SOME_VOLUME/some_standard_lun
/vol/SOME_VOLUME/some_standard_lun 32.0g (34363932672) (r/w, online, mapped)
Serial#: W-XqR4khP1XE
Share: none
Space Reservation: enabled
Multiprotocol Type: aix
Maps: SERVER=3 SERVER=3
The prefix size is in bytes so a little bit of math must be used to figure out the actual offset in sectors.
1 sector on the NetApp platform is 512 bytes, so the offset in the above example is 3584/512 which equals a 7 sector offset.
Setting the Offset Manually
On an existing LUN (preferably a fresh, unused LUN) you can set the offset as follows:
This operation is not officially supported by NetApp and they did not tell us how to do this. If you don’t know what or why you are doing here go away now!
netapp> priv set diag
netapp*> lun create -s -t -P
The above “ should be a number in bytes. A sector on the NetApp platform is 512 bytes so if you want an offset of “7” you would do 512*7 = 3584 bytes for the prefix size.