Viewing NIC information from the ESX server CLI

VMWare ESX server has a bunch of command line utilties to display and modify the ESX server configuration, and the vast majority of them are buried in the /usr/sbin directory. One useful utility is esxcfg-nics, which displays the NIC type, the virtual NIC name, and the current configuration of each NIC in a server:

$ esxcfg-nics -l

Name    PCI      Driver      Link Speed    Duplex Description
vmnic0  02:02.00 tg3         Up   100Mbps  Full   Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
vmnic1  02:02.01 tg3         Up   1000Mbps Full   Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet

If you haven’t had a chance to play with ESX server 3.X, I highly recommend pinging your VMWare sales team to get an eval.

Viewing multipathing information with VMWare ESX Server 3.X

When fibre channel is used to connect a host to storage, multple paths (e.g. cables) can be used to allow the system to load-balanced fibre channel frames over one or more links. This allows a host to transparently handle link failures, and allows your host to keep chugging along when you perform SAN maintenance or a GBIC or SFP fails. To manage the available fibre channel paths, you need to use a multipathing solution (e.g., Sun’s MPXIO, EMC’s powerpath, or Veritas’ DMP, etc.) on the server. VMWare ESX server comes with it’s own multipathing solution (it is better defined as path failover), and provides the esxcfg-mpath utility to view the path information for all of the targets available on a server:

$ esxcfg-mpath -l

Disk vmhba0:0:0 /dev/sda (70007MB) has 1 paths and policy of Fixed
 Local 2:4.0 vmhba0:0:0 On active preferred

Disk vmhba0:1:0 /dev/sdb (70007MB) has 1 paths and policy of Fixed
 Local 2:4.0 vmhba0:1:0 On active preferred

Disk vmhba1:0:0 /dev/sdc (51200MB) has 4 paths and policy of Most Recently Used
 FC 4:4.0 10000000c9413167<->50060161082006e2 vmhba1:0:0 On active preferred
 FC 4:4.0 10000000c9413167<->50060169082006e2 vmhba1:1:0 Standby
 FC 4:5.0 10000000c9413168<->50060160082006e2 vmhba2:0:0 On
 FC 4:5.0 10000000c9413168<->50060168082006e2 vmhba2:1:0 Standby

Disk vmhba1:0:1 /dev/sdd (51200MB) has 4 paths and policy of Most Recently Used
 FC 4:4.0 10000000c9413167<->50060161082006e2 vmhba1:0:1 On active preferred
 FC 4:4.0 10000000c9413167<->50060169082006e2 vmhba1:1:1 Standby
 FC 4:5.0 10000000c9413168<->50060160082006e2 vmhba2:0:1 On
 FC 4:5.0 10000000c9413168<->50060168082006e2 vmhba2:1:1 Standby

You can also retrieve this information from the virtual infrastructure client, but knowing the CLI can be invaluable should a catastrophic failure occur. The more I work with ESX server 3.0, the more I dig it!

Mapping ESX server devices to Linux devices

While poking around on one of our ESX 3.0 beta servers, I came across the esxcfg-vmhbadevs command. This nifty utility allows you to view the Linux device associated with a given VMWare device:

$ /usr/sbin/esxcfg-vmhbadevs -m

vmhba2:0:0:1        /dev/sdc1           444cdb88-b3dc4745-bdb1-00093d11a79c
vmhba2:0:1:1        /dev/sdd1           444cdb9e-eea275ca-eab2-00093d11a79c
vmhba0:0:0:3        /dev/sda3           4476fbec-7f9e4f3e-7d67-00093d11a98e
vmhba2:0:2:1        /dev/sdg1           444cdbbb-be098ef5-45d7-00093d11a79c
vmhba2:0:3:1        /dev/sdh1           44770a21-57ed137c-d2d9-00093d11a98e
vmhba2:0:4:1        /dev/sdi1           44840de1-ab9e7e7d-dcd2-00093d11a98e
vmhba2:0:5:1        /dev/sdj1           447712b9-009decd6-3fc3-00093d11a98e
vmhba2:0:6:1        /dev/sdk1           44771536-e96c381f-561a-00093d11a98e
vmhba2:0:7:1        /dev/sdl1           44771553-cb331da9-6d36-00093d11a98e

$ /usr/sbin/esxcfg-vmhbadevs -q

vmhba0:0:0 /dev/sda
vmhba0:1:0 /dev/sdb
vmhba2:0:0 /dev/sdc
vmhba2:0:1 /dev/sdd
vmhba2:0:2 /dev/sdg
vmhba2:0:3 /dev/sdh
vmhba2:0:4 /dev/sdi
vmhba2:0:5 /dev/sdj
vmhba2:0:6 /dev/sdk
vmhba2:0:7 /dev/sdl
vmhba2:0:8 /dev/sdm
vmhba2:0:9 /dev/sdn
vmhba2:0:10 /dev/sde
vmhba2:0:11 /dev/sdf

In order to run esxcfg-vmhbadevs, you need to have access to the VMWare service console.