LUN Balancing Script
Trolling the VMTN forums today I came across something interesting, a script to balance the LUNs on your ESX hosts across multiple paths:
for PATHS in 2 4 6 8
do
STPATHS=${PATHS}
COUNTER="1"
for LUN in $(esxcfg-mpath -l | 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
Credit goes to KidE for writing the script. I find this to be very interesting as I see Disk I/O as being the largest bottleneck in ESX today ( only experimental Round-Robin mlutipathing is currently available in ESX 3.5.0 ).
Archives
10/01/2006 - 11/01/2006 | 03/01/2007 - 04/01/2007 | 04/01/2007 - 05/01/2007 | 05/01/2007 - 06/01/2007 | 06/01/2007 - 07/01/2007 | 07/01/2007 - 08/01/2007 | 09/01/2007 - 10/01/2007 | 10/01/2007 - 11/01/2007 | 11/01/2007 - 12/01/2007 | 12/01/2007 - 01/01/2008 | 01/01/2008 - 02/01/2008 | 02/01/2008 - 03/01/2008 | 03/01/2008 - 04/01/2008 |