VMware Cloud Community
stanj
Enthusiast
Enthusiast

Looking for example output from an HBA

I am testing with PowerCLI to verify some information for developing some possible scripts.

I was hoping that someone with an ESXi connection to Fiber HBA can execute the  below command and post the output.

thanks

Get-VMhost | Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}}

0 Kudos
11 Replies
LucD
Leadership
Leadership

Have a look at Re: ESXi Inventory Problem with HBA WWNs


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stanj
Enthusiast
Enthusiast

That is an interesting post. 

A lot of info you added in the build script.

What would the results of below snip-it you added return?

@{N="HBA vmhba0 WWN";E={

   $hba = Get-VMHostHBA -VMHost $_ -Type FibreChannel | where{$_.Device -eq 'vmhba0'}

   $wwp = "{0:X}" -f $hba.PortWorldWideName

   (0..7 | %{$wwp.Substring($_*2,2)}) -join ':'

   }},

0 Kudos
LucD
Leadership
Leadership

The WWN in hex format (xx:xx:xx:xx:xx:xx:xx:xx) for vmhba0 on that ESXi node.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stanj
Enthusiast
Enthusiast

Thanks

This may be handy as we move further down the road .

We were first looking for if the ESXi Server had HBAs installed and then check for HBA port numbers.

We were given "Linux commands" examples (below) which, of course, do not work on ESXi and now am looking for CLI or PowerCLI to find similar info.

We also need to find disk numbers, ports, and slot numbers, but not sure if that is possible from PowerCLI.


thanks

How to find the list of HBA cards installed on your system:

# lspci -nn | grep -i hba

07:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

07:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

08:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

08:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

How to check the available HBA ports on the server:

# ls -l /sys/class/fc_host

total 0

lrwxrwxrwx 1 root root 0 Oct 26 17:10 host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:03:00.0/host1/fc_host/host1

lrwxrwxrwx 1 root root 0 Oct 26 17:10 host2 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host2

lrwxrwxrwx 1 root root 0 Oct 26 17:10 host3 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host3

lrwxrwxrwx 1 root root 0 Oct 26 17:10 host4 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host4

How to view used HBA ports on the server:

#ls -lrt /sys/class/fc_transport/

drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:2

drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:1

drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:0

drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:2

drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:1

drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:0

0 Kudos
LucD
Leadership
Leadership

That information should mostly be returned by the Get-VMHostHba cmdlet.

Check if has the info you require with

Get-VMHost | Get-VMHostHba | select *

You can also look at the Get-EsxCli cmdlet.

For example

Get-VMHost | Get-EsxCli -V2 |

ForEach-Object -Process {

    $_.storage.san.fc.list.Invoke()

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stanj
Enthusiast
Enthusiast

thanks

That is the type of commands we will need.

However, i can't get output for HBAs since we only have iSCSI currently.

Could you run a few of those commands on a host connected to an HBA and show the output or message them to me so i can show our team what PowerCLI and CLI can produce ?

thanks

0 Kudos
LucD
Leadership
Leadership

Sorry, no FC HBA my lab at the moment.
There is a sample output of the cmdlet on page 69 of the PowerCLI Reference Ed 1

Also, the online help for the Get-VMHostHba cmdlet shows the type of object that the cmdlet produces.

In the HBA object you will see all the properties of that object.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stanj
Enthusiast
Enthusiast

ok,

thanks for the tips..

i was able to find the below document as well, 

https://buildmedia.readthedocs.org/media/pdf/powercli-core/latest/powercli-core.pdf

and on page 123 there are some example commands.

If I run the below command on my ESXi 6.7 Server, i get nothing listed (probably because I don't have FibreChannel HBAs?)

Get-VMHostHba -Type FibreChannel

But, if I run

Get-VMHostHba -Type iSCSI , I get back,

Device       Type         Model                                   Status

------           ----            -----                                       ------

vmhba66    IScsi        iSCSI Software Adapter        online

Meaning i am using the iSCSI software to connect to the Dell internal storage?

0 Kudos
LucD
Leadership
Leadership

Yes, your assumption is correct.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stanj
Enthusiast
Enthusiast

Excellent Smiley Happy

By using PowerCli, is there a way to find disk slots that drives reside in and ID numbers, among other items.

0 Kudos
LucD
Leadership
Leadership

You are talking about the LUNs presented in the SAN I assume?

In most storage solutions the LUNs you see are virtual, in other words the storage manager creates a virtual LUN, and depending on the RAID level, that LUN would live on multiple physical disks.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos