How to validate switchport and active uplink ID of a virtual machine
search cancel

How to validate switchport and active uplink ID of a virtual machine

book

Article ID: 435765

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

This KB article outlines the procedures for identifying and validating Virtual Machine (VM) switchports and their associated physical uplinks using the ESXi Command Line Interface (CLI). These steps are essential for performing granular packet captures, analyzing real-time traffic flow, and monitoring interface statistics for troubleshooting network connectivity.

Environment

VMware NSX
VMware vSphere

Resolution

  • If the VM is connected to NSX port-group

Use the command 'nsxdp-cli vswitch instance list' to identify switchport ID and Uplink. In the example below UPSA-1.eth0 is connected to NSX segment. The switchport ID is 67108882 and uplink is vmnic1.

[root@esx:~] nsxdp-cli vswitch instance list
DvsPortset-0 (NSX-Switch)    50 ## 00 ## ## c0 ## 24-a0 ec ## ## ## ## 48 44
Total Ports:2060 Available:2045
  Client                         PortID          DVPortID                             MAC                  Uplink          VID              VNI

  vdr-vdrPort                    67108879        vdrPort                              02:50:56:56:44:52    vmnic1                           214748####
  UPSA-1.eth0                    67108882        6700d4e6-5c0b-####-####-1e0f2dea0b5d 00:50:56:##:##:##    vmnic1          0                65536

  • If the VM is connected to non-NSX port-group

Use one of the following methods -

Method 1

Identify the World ID associated with the VM using 'esxcli network vm list'.

For e.g., here world ID is 3481969

[root@esx:~] esxcli network vm list
World ID  Name    Num Ports  Networks
--------  ------  ---------  --------
 3481969  UPSA-1          2  dvportgroup-34,

Using world ID identify the switchport and uplink. Here switchport is 67108880 uplink is vmnic0.

[root@esx:~] esxcli network vm port list -w 3481969
   Port ID: 67108880
   vSwitch: RegionA01-VDS8
   Portgroup: dvportgroup-34
   DVPort ID: 3
   MAC Address: 00:50:56:##:##:##
   IP Address: 0.0.0.0
   Team Uplink: vmnic0
   Uplink Port ID: 2214592517
   Active Filters:

Method 2

Identify switchport using command 'net-stats -l'.

[root@esx:~] net-stats -l
PortNum          Type SubType SwitchName       MACAddress         ClientName

67108880            5       9 DvsPortset-0     00:50:56:##:##:##  UPSA-1.eth1
67108882            5       9 DvsPortset-0     00:50:56:##:##:##  UPSA-1.eth0
[root@esx:~]

Run 'esxtop' and press 'n' to go to network resource screen. Look for VM name and PORT-ID TEAM-PNIC.

 PORT-ID USED-BY                         TEAM-PNIC DNAME              PKTTX/s  MbTX/s   PSZTX    PKTRX/s  MbRX/s   PSZRX %DRPTX %DRPRX

67108880 3481969:UPSA-1.eth1                vmnic0 DvsPortset-0          0.00    0.00    0.00       0.00    0.00    0.00   0.00   0.00
67108882 3481969:UPSA-1.eth0                vmnic1 DvsPortset-0          0.00    0.00    0.00       0.00    0.00    0.00   0.00   0.00

Note: To change screen refresh delay press 's' and enter the seconds.

Seconds to delay:
   PORT-ID USED-BY                         TEAM-PNIC DNAME              PKTTX/s  MbTX/s   PSZTX    PKTRX/s  MbRX/s   PSZRX %DRPTX %DRPRX