HPE EVA Storage

multipath script to balance I/O to a HP EVA 8000 (ESX Script)

 

multipath script to balance I/O to a HP EVA 8000 (ESX Script)

Howdy, all,

Running HP Blades connected via dual fabrics to active/active HP EVA 8000 SAN

Used the below script on a test esx server. It works in a fashion in that it cycles through the LUNs and changes the preferred paths from the default of the first path. It does not hiowever change the active path.


I am a complete novice at scripts - is there a way to do this , the script examples on the net seem to show that the active path changed along with the preferred path!


One other thing, is there any way to alter the script to specifically exclude 2 of the paths 9so that physcial windows boxes can use those paths in isolation ?


heres the script

for PATHS in 2 4 6 8
do STPATHS=${PATHS}
COUNTER="1"
for LUN in $(esxcfg-mpath -l | grep "Disk" | grep "has ${STPATHS} paths" | awk '{print $2}')
do
esxcfg-mpath --lun=${LUN} --path=$(esxcfg-mpath -q --lun=${LUN} |\
grep FC | awk '{print $4}' | awk '{print NR "S\t " $0}' | \
grep ${COUNTER}S | awk '{print $2}') --preferred
COUNT=`expr ${COUNTER} + 1`
COUNTER=${COUNT}
if [ ${COUNTER} -gt ${STPATHS} ]
then
COUNTER="1"
fi
done
done


on test server before running script I get.:::

--root@xxx updates--# esxcfg-mpath -l

Disk vmhba0:0:8 /dev/sdg (512000MB) has 8 paths and policy of Fixed
FC 65:0.0 5001438002b097c8<->50001fe1500b1808 vmhba0:0:8 On active preferred
FC 65:0.0 5001438002b097c8<->50001fe1500b180a vmhba0:1:8 On
FC 65:0.0 5001438002b097c8<->50001fe1500b180c vmhba0:2:8 On
FC 65:0.0 5001438002b097c8<->50001fe1500b180e vmhba0:3:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b1809 vmhba1:0:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180b vmhba1:1:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180d vmhba1:2:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180f vmhba1:3:8 On

Disk vmhba0:1:1 /dev/sdw (256000MB) has 8 paths and policy of Fixed
FC 65:0.0 5001438002b097c8<->50001fe1500b180a vmhba0:1:1 On active preferred
FC 65:0.0 5001438002b097c8<->50001fe1500b180c vmhba0:2:1 On
FC 65:0.0 5001438002b097c8<->50001fe1500b180e vmhba0:3:1 On
FC 65:0.0 5001438002b097c8<->50001fe1500b1808 vmhba0:0:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b1809 vmhba1:0:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180b vmhba1:1:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180d vmhba1:2:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180f vmhba1:3:1 On

after script I get

Disk vmhba0:0:8 /dev/sdf (512000MB) has 8 paths and policy of Fixed
FC 65:0.0 5001438002b097c8<->50001fe1500b1808 vmhba0:0:8 On active preferred
FC 65:0.0 5001438002b097c8<->50001fe1500b180a vmhba0:1:8 On
FC 65:0.0 5001438002b097c8<->50001fe1500b180c vmhba0:2:8 On
FC 65:0.0 5001438002b097c8<->50001fe1500b180e vmhba0:3:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b1809 vmhba1:0:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180b vmhba1:1:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180d vmhba1:2:8 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180f vmhba1:3:8 On

Disk vmhba0:1:1 /dev/sdv (256000MB) has 8 paths and policy of Fixed
FC 65:0.0 5001438002b097c8<->50001fe1500b180a vmhba0:1:1 On active
FC 65:0.0 5001438002b097c8<->50001fe1500b180c vmhba0:2:1 On preferred
FC 65:0.0 5001438002b097c8<->50001fe1500b180e vmhba0:3:1 On
FC 65:0.0 5001438002b097c8<->50001fe1500b1808 vmhba0:0:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b1809 vmhba1:0:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180b vmhba1:1:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180d vmhba1:2:1 On
FC 65:0.1 5001438002b097ca<->50001fe1500b180f vmhba1:3:1 On

and so on - so the preffered path is changed but not the active one.


Any help appreciated.