The algorithm used for selecting the stateless/stateful caching changed in ESXi 5.5 Patch 2. In both cases LUN 0 will not be selected to highlight how the selection algorithm works before and after ESXi 5.5 P2.
Behavior prior ESXi 5.5 Patch 2
- The LUN's and their working paths are enumerated first. The working paths are not sorted at this time.
(LUN 2)naa.60060e8007db81000030db810000e13f:
Working Paths: vmhba1:C0:T0:L2, vmhba1:C0:T1:L2, vmhba2:C0:T1:L2, vmhba2:C0:T0:L2
(LUN 0)naa.60060e801602f900000102f90000c125:
Working Paths: vmhba1:C0:T1:L0, vmhba1:C0:T0:L0, vmhba2:C0:T1:L0, vmhba2:C0:T0:L0
(LUN 1)naa.60060e8007db81000030db810000e12c:
Working Paths: vmhba1:C0:T1:L1, vmhba1:C0:T0:L1, vmhba2:C0:T1:L1, vmhba2:C0:T0:L1
- The first working path is chosen for each LUN before the final sorting
(LUN 2)vmhba1:C0:T0:L2 - naa.60060e8007db81000030db810000e13f
(LUN 0)vmhba1:C0:T1:L0 - naa.60060e801602f900000102f90000c125
(LUN 1)vmhba1:C0:T1:L1 - naa.60060e8007db81000030db810000e12c
- The list is then sorted to select the LUN to be used for the stateless/stateful caching disk.
(LUN 2)vmhba1:C0:T0:L2 - naa.60060e8007db81000030db810000e13f selected LUN
(LUN 0)vmhba1:C0:T1:L0 - naa.60060e801602f900000102f90000c125
(LUN 1)vmhba1:C0:T1:L1 - naa.60060e8007db81000030db810000e12c
In the preceding example LUN 0 was not picked as when the first working paths were selected vmhba1:C0:T1:L0 (Step 2) was used instead of vmhba1:C0:T0:L0.
Behavior after ESXi 5.5 Patch 2 and later
In this example the working paths will be changed to highlight what may happen when presenting LUN's from multiple SAN's. SAN 1 is presenting on targets 0 and 1 while SAN 2 is presenting on target 2 and 3.
- The LUN's and their working paths are enumerated first. A sort is now introduced to prevent the issues observed in the previous example.
(LUN 2)naa.60060e8007db81000030db810000e13f:
Sorted Working Paths: vmhba1:C0:T0:L2, vmhba1:C0:T1:L2, vmhba2:C0:T0:L2, vmhba2:C0:T1:L2
(LUN 0)naa.60060e801602f900000102f90000c125:
Sorted Working Paths: vmhba1:C0:T2:L0, vmhba1:C0:T3:L0, vmhba2:C0:T2:L0, vmhba2:C0:T3:L0
(LUN 1)naa.60060e8007db81000030db810000e12c:
Sorted Working Paths: vmhba1:C0:T0:L1, vmhba1:C0:T1:L1, vmhba2:C0:T0:L1, vmhba2:C0:T1:L1
- The first working path is chosen for each LUN before the final sort.
(LUN 2)vmhba1:C0:T0:L2 - naa.60060e8007db81000030db810000e13f
(LUN 0)vmhba1:C0:T2:L0 - naa.60060e801602f900000102f90000c125
(LUN 1)vmhba1:C0:T0:L1 - naa.60060e8007db81000030db810000e12c
- The list is sorted to select the LUN to be used for the stateless/stateful caching disk.
(LUN 1)vmhba1:C0:T0:L1 - naa.60060e8007db81000030db810000e12c selected LUN
(LUN 2)vmhba1:C0:T0:L2 - naa.60060e8007db81000030db810000e13f
(LUN 0)vmhba1:C0:T2:L0 - naa.60060e801602f900000102f90000c125
In the above example LUN 0 was not selected as it is presented from target 2 ( vmhba1:C0:T2:L0). To have the remote option pick LUN 0 the LUN would need to be presented on the lowest target number and lowest LUN number.