Check Paths on FC-HBA’s

Check Paths on FC-HBA’s

Often you have to check the paths on your hosts.

At least if you upgrade your UCS or SAN infrastructure 😉 Do it with PowerCLI!

I spent a big amount of time last week doing research on this topic, doing these checks with PowerCLI.

I just wanted to see (per host) which HBA has it’s paths to his storage (like in the vSphere Client):

There are lots of approaches for this.

jfrmilner: Check for “Dead” paths on HBAs with PowerCLI

or this performance optimized version PowerCLI: Show HBA Path Status

But every script I found was displaying incorrect path numbers. They all made the same mistake, counting the paths from datastore side. If you want to get the same result as in vSphere client, you should have a look on my script.

So I had to find my way …

At this point there goes a big thank you to “PowerCLI God” LucD 😉

Finally I came up with a script that does exactly what I have imagined:


The output should look like this:


There is a cosmetic issue in ESXi 6.0 U3! See VMware KB 2149992

This causes a wrong number of active paths shown.


It works correctly again with ESXi 6.5 U1 🙂

14 thoughts on “Check Paths on FC-HBA’s

    1. Check Line 75, there is a where condition that maybe does not fit to your environment. You can troubleshoot if you check the output of: $esx.ExtensionData.Config.StorageDevice.HostBusAdapter

      1. Tried that too….still blank output….moreover it start and ends withing a second, so probably script is not even triggering

        1. Did you execute the function and call it afterwards? Like
          Get-FCPaths -vHost myHost-*
          If still empty, just query the two lines:
          $esx = Get-VMHost -Name yourESXiHost

          The output is maybe huge(depends on your adapter counts), you have to search your FC- HBA and look what is beside “Drivers”

          In my case it’s a Qlogic HBA -> “qlnativefc”

  1. Hello Chris , there is a cosmetic problem as per kb 2149992 as ur aware which i think may not have any resolution sooner ,
    i figured out an alternative while i was testing VMware powercli vs esxcli , i found esxcli output are fine , that is when i researched to find to esxcli in powercli
    here’s what i did ..
    $AllHosts = Get-VMHost
    $esxcli = Get-EsxCli -VMhost $AllHosts -V2
    $| select DeviceDisplayName,Adapter , State

    Out put simillar to
    output simillar to
    XX Fibre Channel Disk (naa.6012334892749287487290934098.. vmhba4 active
    XX Fibre Channel Disk (naa.6883482740872472742797297948… vmhba64 active

    now that am able to the state info , how can i use in your script and get the resultant output , please help .. thank you

    1. Hey, did you really get the correct information about the standby and active paths? As I mentioned, it works again with 6.5. I see no reasons to change that script.

    1. Sure, you add “| ConvertTo-Csv”

      Maybe something like:
      Get-FCPaths -DataCenter [myDatacenter] | ConvertTo-Csv

Leave a Reply to Christoph Hochsticher Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.