VMware Cloud Community
enterpriseda
Contributor
Contributor

Esx Hba Path

Hi,

I have an Esx Serer with 2 Hba -- > vmhba2 and vmhba3

when i use esxtop with d option i see all disk traffic pass through the vmhba2.

So i tryed configured one lun to preferred path vmhba3:0:x and also i have disabled all path for vmhba2:0:x.

So i had stared a file copy to the lun i fixed to vmhba3 but in esxtop with d switch i always see disc traffic through vmhba2 !

If i use esxcfg-mpat -q on the Lun i fixed the path i see that other paths on vmhba2 are disabled but i don't understant why disk traffic doesn't pass through the other hba.

thanks

Reply
0 Kudos
9 Replies
doug
Contributor
Contributor

I'm seeing the same...still looking into it...not sure yet if it's a problem with setting the active path or with reporting usage figures...if you work this out I'd appreciate an update

Reply
0 Kudos
grasshopper
Virtuoso
Virtuoso

Not sure if it's the same in ESX3, but historically, ESX would always report statistics down the first path scanned by the vmkernel, regardless of the active path.

Reply
0 Kudos
doug
Contributor
Contributor

thanks grasshopper....so how would you verify the path being used?

Reply
0 Kudos
grasshopper
Virtuoso
Virtuoso

sorry bud... I'm saving up for a supported controller, so I can't answer any 3.x questions yet Smiley Sad

Reply
0 Kudos
sbeaver
Leadership
Leadership

You can use this script if you have more then one HBA to check the path and load balance

PREVIOUS="vmhba0"

echo "Starting HBA Balance....."

case "$1" in

-c)

  1. Show current config

echo >> /root/PostInstall/PostInstall.log

echo "****** CURRENT HBA/LUN CONFIG ******"

echo

for LUN in $(esxcfg-vmhbadevs | tail +2 | awk '\{print $1}')

do

esxcfg-mpath -q --lun=$\{LUN} | grep FC

echo

done

;;

-p)

  1. Show new config

echo

echo "****** PREVIEW NEW BALANCED HBA/LUN CONFIG ******"

echo

for LUN in $(esxcfg-vmhbadevs | tail +2 | awk '\{print $1}')

do

CURRENT=$(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep "preferred" | awk '\{print $4}' | awk -F ":" '\{print $1}')

if [\[ $\{CURRENT} = $\{PREVIOUS} ]]

then

NEW=$(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v "preferred" | awk '\{print $4}' | awk -F ":" '\{print $1}')

if [\[ $\{NEW} = vmhba1 ]]

then

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep $\{NEW} | awk '\{print " " $1, $2, $3, $4, $5}') "active preferred"

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v $\{NEW} | awk '\{print " " $1, $2, $3, $4, $5}')

else

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v $\{NEW} | awk '\{print " " $1, $2, $3, $4, $5}')

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep $\{NEW} | awk '\{print " " $1, $2, $3, $4, $5}') "active preferred"

fi

PREVIOUS=$\{NEW}

echo

else

if [\[ $\{CURRENT} = vmhba1 ]]

then

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep $\{CURRENT})

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v $\{CURRENT})

else

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v $\{CURRENT})

echo $(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep $\{CURRENT})

fi

PREVIOUS=$\{CURRENT}

echo

fi

done

;;

-e)

  1. Execute new config

for LUN in $(esxcfg-vmhbadevs | tail +2 | awk '\{print $1}')

do

CURRENT=$(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep "preferred" | awk '\{print $4}' | awk -F ":" '\{print $1}')

if [\[ $\{CURRENT} = $\{PREVIOUS} ]]

then

NEW=$(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v "preferred" | awk '\{print $4}' | awk -F ":" '\{print $1}')

NEWPATH=$(esxcfg-mpath -q --lun=$\{LUN} | grep FC | grep -v "preferred" | awk '\{print $4}')

esxcfg-mpath --lun=$\{LUN} --path=$\{NEWPATH} --preferred

PREVIOUS=$\{NEW}

else

PREVIOUS=$\{CURRENT}

fi

done

echo

echo "****** NEW HBA CONFIG *****"

echo

for LUN in $(esxcfg-vmhbadevs | tail +2 | awk '\{print $1}')

do

esxcfg-mpath -q --lun=$\{LUN} | grep FC

echo

done

echo

echo "****** \"active\" flag will be moved after disk activity *****"

echo

;;

*)

echo $"Usage: balancelun \{-c (current config)| -p (preview new config) -e (implement new config)}"

exit 1

esac

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
doug
Contributor
Contributor

nice script, it will be useful thanks....however I'd really like to verify the path being used by seeing some stats about traffic on it...any ideas how this might be achieved?

Reply
0 Kudos
Mike_Fink
Enthusiast
Enthusiast

I am not sure how to 100% determine the active path in the SC, I have always just set my paths and assumed that VMware did what it said it was going to do.

However, it should be relatively simple to determine; just look at the FC switch port stats, or the SAN IOps stats, you should be able to see where the traffic is flowing (and if it is heading out the HBA you requested).

I can offer assistance using NetApp SAN and Brocade switches (on how to get these stats out of the devices). Other then that, I defer to the other SAN experts out there in the respective technologies.

Reply
0 Kudos
doug
Contributor
Contributor

In case anyone is interested....

I have confirmed that "esxcfg-mpath -l" displays the actual path being used by loading up VMs, disconnecting each vmhba in turn and observing what happens.

So this is definitely a stats reporting issue (esxtop and the client UI) rather than incorrect pathing.

thanks everyone

Reply
0 Kudos
figlesiasrads
Contributor
Contributor

Haven't done much with ESX scripting. What is the process for getting this to work? Thanks.

Reply
0 Kudos