This is a handy little trick that many of you may already know. Starting with version 3.5, VMware added support for Cisco Discovery Protocol (CDP) on the ESX Server vSwitches. CDP support is enabled on a vSwitch with this command:
esxcfg-vswitch -B both vSwitch0
The “-B” parameter is case-sensitive; the “-b” (note the lowercase B) displays CDP status while the “-B” (uppercase B) configures CDP.
Once CDP support is enabled on the vSwitch—and assuming it is enabled on the physical switch—running the “show cdp neighbor” IOS command will show the link between each physical switch port and the matching ESX Server NIC. The output will look something like this:
Capability Codes: R-Router, T-Trans Bridge, B-Source Route Bridge
S-Switch, H-Host, I-IGMP, r-Repeater, P-Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
s3 Gig 0/26 147 T S WS-C3524-XFas 0/24
esx04 Gig 0/22 168 S VMware ESXvmnic0
esx04 Gig 0/21 168 S VMware ESXvmnic1
As you can see in the output above, the CDP output clearly links the physical switch port and the ESX Server NIC. This makes it incredibly easy to identify the NICs in the server. This is particularly helpful in blade situations, since you can’t exactly unplug the NIC and see which one goes down with “esxcfg-nics -l” (a common approach to identifying the NICs in the server). Of course, this requires Cisco switches in the blade chassis. Since the internal port mappings on the blade chassis determine which NICs connect to which ports, this command adds the mapping within ESX Server and lets us quickly and definitively identify the NICs in the server as seen by ESX Server.
Tags: Cisco, ESX, Hardware, Networking, Virtualization, VMware


8 comments
Comments feed for this article
Trackback link
http://blog.scottlowe.org/2008/03/11/identifying-esx-server-nics-in-blades/trackback/
Tuesday, September 16, 2008 at 5:01 pm
Pingback from Challenges integrating VMware into Cisco networks | Colin McNamara - CCIE 18233 , RHCE, GCIH, CCVP, GEEK
Tuesday, March 11, 2008 at 4:45 pm
Duncan
this is one of the most used new features when troubleshooting nic problems.
Friday, April 4, 2008 at 10:42 am
Cassandra Stinson
Excellent…Your site is always my first choice…
Wednesday, April 30, 2008 at 11:01 am
Cisco Home Lab
Scott,
Be careful. I may have to replace Google with your website when searching for answers to all of my VMWare related network questions.
I can’t tell you how happy this features makes me. I spent nearly a day tracing wires from NIC’s to switch to create a network diagram for our VMWare environment. Even though I have already done that work, I appreciate having CDP available.
Friday, May 2, 2008 at 3:20 pm
Duane Haas
anyone have any insight on how to identify what virtual port on an cisco virtual connect switch in a hp blade enclosure
Friday, May 2, 2008 at 5:33 pm
slowe
Duane,
I’m not sure I understand your question. Internal connections from the blades to the VC switches are determined by the port mapping, which is a fixed pathing that says NIC 1 on blade 1 goes here, NIC 2 goes here, etc.
From there, VirtualConnect Manager lets you define profiles that determine on a per-slot basis which NICs connect to which networks and which networks run over which uplinks.
I wrote an article about using VirtualConnect with ESX here:
http://searchvmware.techtarget.com/tip/0,289483,sid179_gci1295274,00.html
Hope this helps!
Saturday, May 3, 2008 at 2:32 pm
Duane Haas
scott, thanks for the link. sorry my question was phrased poorly. i am trying to find out if I setup virtual connect, and i have a full height blade that has 4 internal nics, it will show me ports 1-4 on the virtual connect side in ther server profile i setup. how can i tell what virtual nics those map too? The obvious answer to me is to change each port to unassigned and watch the nics go down in esx, but if I dont want to take them down but want to understand how they map back to the port numbers in esx i cant seem to find an easy way.
Saturday, May 3, 2008 at 10:12 pm
slowe
Duane,
Ah, now I understand. At this point, you are back to the “old fashioned” way of doing it, just like you described: use VirtualConnect Manager to set the port to Unassigned and then use esxcfg-nics to see which NIC went down. I don’t know of any other way to do it. VirtualConnect does not help with the mapping of the physical NICs to the vmnics, as far as I know.
Hope this helps!