VMware

This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
3 Replies Last post: Mar 31, 2008 5:13 PM by rossb2b  

Auto LUN balancing script v2.1 posted: Mar 31, 2008 4:57 PM

Click to view KidE's profile Enthusiast 38 posts since
Feb 27, 2006
Hereby i post the new version of the HBA auto lunbalancing script version 2.1

It doesn't matter if you have 2 4 6 or 8 storage paths to your LUNs this will balance it automaticly for you to spread the load.

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

Happy MPIO ;-)

Re: Auto LUN balancing script v2.1

1. Mar 31, 2008 5:00 PM in response to: KidE
Click to view rossb2b's profile Expert 237 posts since
Aug 30, 2006
This looks interesting. It just so happens I will be able to test it in my development environment in the next week or so. I will let you know how it works.

Re: Auto LUN balancing script v2.1

3. Mar 31, 2008 5:13 PM in response to: KidE
Click to view rossb2b's profile Expert 237 posts since
Aug 30, 2006
Awesome!

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities