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
-
Excellent…Your site is always my first choice…
-
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.
-
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.
-
Greetings,
Does any one know the command to disable the NIC interface using ESX command line interface.
Thanks
Ahmed -
With CDP enabled on ESX/ESXi will the host simply recieve CDP packets or will it also generate CDP packets? Our network team will veto any device generating CDP packets that they do not administer.
Thanks.
-
Thanks.
How do you specify recieve-only?
-
Great information as usual.
We’re starting to trial HP blades at the moment (BL460c) and I’m trying to think how we would network ESX.
Our network guys at the moment say they see no need for virtual connect and are planning on using 2 x Cisco 3120 switches per chassis for normal servers.
For ESX servers though this is not so simple. How are people networking up blades and are you using Cisco 3120 type switches or virtual connect.
How many Nics are you putting in your ESX hosts (what extra mezzanine cards) and how are they connected up / what port groups are you creating / what traffic are you sharing and what failover decisions have you made.
Would be very interesting to get people’s opinion.
-
Julian - Full disclosure, I work with Scott (and post here sometimes) so my experience will mirror Scott’s to a large degree. Hopefully, Scott will agree with me!
If you are using FC to go to your SAN, I would consider the minimum number of Ethernet ports to be 4. If you are using IP based storage, then I would go with 6. If you are doing a large deployment, I would bump the numbers up to 6 and 8.
Take a look at this post and let me know if you have any questions:
Thanks!




15 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2008/03/11/identifying-esx-server-nics-in-blades/trackback/