VMware Cloud Community
nmvega
Contributor
Contributor
Jump to solution

esx 3.5 (unix) command line to get the S/W iSCSI vmhba number ...

Hello all:

I turned on the S/W iSCSI client and enabled the iSCSI firewall port on my ESX 3.5 server (using the

command line).

After performing those pre-requesite steps, how does one, using an esx* or vm* CLI command, probe the

system to get the iSCSI initiator name? vmhbaXX

I tried several CLI command variations, as well as cat(1)ing out various data structures under /proc/vmware/,

but without success. I'm sure I missed doing the one thing that would work :-).

Note that in the VI/VC client I can see that it is "vmhba34", but I'm trying to get that same information

from the command line (pretending as if the GUI were not available to me).

Thanks in Advance,

Noel Milton

nmvega@ComputingArchitects.Com

Reply
0 Kudos
1 Solution

Accepted Solutions
mike_laspina
Champion
Champion
Jump to solution

I see that you have not defined any connections to a target yet. Once the path is established it will show the initiator name there.

You can also use

esxcfg-info -s

all HBA's will be listed there

http://blog.laspina.ca/ vExpert 2009

View solution in original post

Reply
0 Kudos
10 Replies
mike_laspina
Champion
Champion
Jump to solution

Hi,

The software initiator names are stored in a file in the /etc/initiatorname.vmkiscsi file

You can use the cat command to display it.

cat /etc/initiatorname.vmkiscsi

http://blog.laspina.ca/ vExpert 2009
mike_laspina
Champion
Champion
Jump to solution

If you would like to see what HBA the initiator maps to use

esxcfg-mpath -l

http://blog.laspina.ca/ vExpert 2009
nmvega
Contributor
Contributor
Jump to solution

Hi Mike:

Thanks and you're correct...

==========================

root# cat /etc/initiatorname.vmkiscsi

GenerateName=yes

InitiatorName=iqn.1998-01.com.vmware:esx01-0bb8fef1

==========================

But I'm looking for the "vmhbaXX" name instead.

Perhaps one of the CLI commands can be used to "dereference"

the iqn name (in /etc/initiatorname.vmkiscsi) back to a

vmhbaXX name.

Unless it is normally in that same file, and is missing in

my case.

Reply
0 Kudos
nmvega
Contributor
Contributor
Jump to solution

Yes... Strange because that command does list the local disk vmhba numbers

(for /dev/sda and /dev/sdb respectively), but not the iSCSI one which

is vmhba34 (and yet I see vmhba34 in the VI client)...

root# esxcfg-mpath -vl

Disk vmhba32:0:0 vml.0100000000355144325752474c202020202020202020202020534541474154 /dev/sda (715404MB) has 1 paths and policy of Fixed

Local 0:5.0 vmhba32:0:0 On active preferred

Disk vmhba33:0:0 vml.01000000003551443047573337202020202020202020202020534541474154 /dev/sdb (715404MB) has 1 paths and policy of Fixed

Local 0:5.0 vmhba33:0:0 On active preferred

Reply
0 Kudos
nmvega
Contributor
Contributor
Jump to solution

Mike:

You got me thinking about the command a little more...

This variation worked...

esxcfg-mpath -a

root# esxcfg-mpath -a

vmhba34 iqn.1998-01.com.vmware:esx01-0bb8fef1 sw

Thank you for your help Mike.

Reply
0 Kudos
mittim12
Immortal
Immortal
Jump to solution

They showed up when I ran the command. Do you have your iSCSI connected to any storage?

Disk vmhba32:0:0 /dev/sda (302364MB) has 1 paths and policy of Fixed

iScsi sw iqn.1998-01.com.vmware:XXXXXXXXXXX<->iqn.XXXXX.XXXXXXXXXXXX vmhba32:0:0 On active preferred

Disk vmhba32:0:1 /dev/sdb (1613201MB) has 1 paths and policy of Fixed

iScsi sw iqn.1998-01.com.vmware:XXXXXXXXXXXX<->iqn.XXXXXXX.XXXXXXXXXXX vmhba32:0:1 On active preferred

If you found this or any other post helpful please consider the use of the Helpfull/Correct buttons to award points

Reply
0 Kudos
mike_laspina
Champion
Champion
Jump to solution

I see that you have not defined any connections to a target yet. Once the path is established it will show the initiator name there.

You can also use

esxcfg-info -s

all HBA's will be listed there

http://blog.laspina.ca/ vExpert 2009
Reply
0 Kudos
nmvega
Contributor
Contributor
Jump to solution

Hi:

Not yet, as I am setting this up now (strictly using the command line).

Im sure you know this, but as you progress though the command line to set up an

iSCSI based datastore, eventually you get to the command "vmkiscsi-tools -D -a IPAddress vmhbaXX"

and other commands that require specifying the "vmhbaXX" parameter that will connect

it to storage. And that is where I was looking for the command that divulges the

"vmhbaXX" information. Perhaps when an iSCSI adapter it is not connected to storage it does not

show up in "esxcfg-mpath -l". In any case, the "-a|--hbas" option is described as follows (which

seemed to work):

List HBAs on the system with a unique ID if one is available.

Something new everyday.

Thank you mittim12.

Reply
0 Kudos
nmvega
Contributor
Contributor
Jump to solution

Understood. Thank you both!

Reply
0 Kudos
nmvega
Contributor
Contributor
Jump to solution

Btw... I'll inserted this here for completeness in case someone comes searching for

the same answer in the future (i.e. looking for a vmhba instance number for a non

LUN connected iSCSI adapter):

root# esxcfg-mpath -a

-or-

root# esxcfg-info -s | grep -B 2 iscsi_mod

Example:

root# esxcfg-info -s | grep -B 2 iscsi_mod

|----Name...............................................vmhba34

|----Console Name.......................................scsi3

|----Driver.............................................iscsi_mod

root#

Reply
0 Kudos