CUC (6) CUCM (26) Jabber (6) Python (2) Routing (3) Solarwinds Orion NPM (4) switching (1) Video (6) voice (2)

Friday, 22 February 2013

ESXI 5.x CLI basic network diagnostics

How crap can ESXi be when trying to work it in a port-channel and trunked set up.
I am writing this post, because I am forced to. 

I built a UCS C200M with 3 virtual machines ages ago and had to put the project on the back burner, after months I hooked everything back up; 2900 series, 2960 and the UCS, and for the life of me I could not get into the ESXi host anymore. The only access I had is the console, death by shell it shall be then!!

in order to get access to the shell, through console or SSH, you will first have to switch in on, by going to the console and enabling it through "Troubleshooting mode options" at the main screen.

Because I could see both ports on the switch patched to the UCS up, I was not assuming a duplex or speed mismatch, checking the physical nics:

~ # esxcli network nic list

Name    PCI Device     Driver  Link  Speed  Duplex  MAC Address         MTU  Description                                     
------  -------------  ------  ----  -----  ------  -----------------  ----  -------------------------------------------------
vmnic0  0000:001:00.0  igb     Up     1000  Full    e4:d3:f1:d0:5c:1e  1500  Intel Corporation I350 Gigabit Network Connection
vmnic1  0000:001:00.1  igb     Down      0  Half    e4:d3:f1:d0:5c:1f  1500  Intel Corporation I350 Gigabit Network Connection

Next thing for me to check is where on the vswitch the ESXi host was residing, to find out the vswitches on the ESXi host:

~ # esxcli network vswitch standard list

   Name: vSwitch0
   Class: etherswitch
   Num Ports: 128
   Used Ports: 7
   Configured Ports: 128
   MTU: 1500
   CDP Status: listen
   Beacon Enabled: false
   Beacon Interval: 1
   Beacon Threshold: 3
   Beacon Required By:
   Uplinks: vmnic0
   Portgroups: VM Network, Management Network

The above tells me all VM's as well as the ESXi management network resides on the same vswitch.

~ # esxcli vm process list

   World ID: 9820   <----------keep the world ID to get more detailed information
   Process ID: 0
   VMX Cartel ID: 9816
   UUID: 56 4d 5b ef 2c d7 23 37-5d 5d b8 90 74 78 58 0c
   Display Name: CUCM
   Config File: /vmfs/volumes/50e597ea-5c57efa8-fe44-e4d3f1d05c1e/CUCM/CUCM.vmx

   World ID: 10174
   Process ID: 0
   VMX Cartel ID: 10173
   UUID: 56 4d 21 1e 3e 09 1c db-ed 63 51 3a 31 67 43 53
   Display Name: CUC
   Config File: /vmfs/volumes/50e597ea-5c57efa8-fe44-e4d3f1d05c1e/CUC/CUC.vmx

   World ID: 10247
   Process ID: 0
   VMX Cartel ID: 10246
   UUID: 56 4d 5c e9 aa 00 74 cb-63 b0 bc 4b bb de f3 c1
   Display Name: CUAC
   Config File: /vmfs/volumes/50e597ea-5c57efa8-fe44-e4d3f1d05c1e/CUAC/CUAC.vmx
~ # esxcli network vm port list -?

To find out the port and vswitch configuration for a particular virtual machine, copy the world ID (see above), and use it to issue it in the command below:

~ # esxcli network vm port list -w 9820
   Port ID: 33554438
   vSwitch: vSwitch0
   Portgroup: VM Network<---port group Virtual machine belongs to
   DVPort ID:
   MAC Address: 00:0c:29:78:58:0c
   IP Address:
   Team Uplink: vmnic0
   Uplink Port ID: 33554434
   Active Filters:

To find out about the details of the port groups and their respective VLAN's:

~ # esxcli network vswitch standard portgroup list

Name                                      Virtual Switch  Active Clients  VLAN ID
------------------                         --------------         --------------        -------
Management Network          vSwitch0                     1                0
VM Network                           vSwitch0                     3                0

In the output above you can see that the port group called "VM network" has 3 active clients (~ # esxcli vm process list), and port group "Management network" has one active client, which is the management instance.

Another good command is to get send and receive packet stats on a certain vmnic:

~ # esxcli network nic vlan stats get -n vmnic0
   Packets received: 118
   Packets sent: 77

No comments:

Post a Comment