One of the vSphere environments I support uses Juniper EX4200 switches for networking. Juniper switches don’t support Cisco Discovery Protocol (CDP). I love CDP because I can tell exactly what switch & port I’m attached to, and see other information like VLANs, etc. CDP removes a lot of human error from our operations, too. I love it for situations like when two cables are mysteriously labeled as heading to the same switch port or I’m sitting at my desk and I need to refer to a physical port 200 miles north of me. It also means that I don’t need to maintain a document of the switch ports, I can script a dump of the information if I need an offline copy.
VMware vSphere 5.0+ adds support for Link Layer Discovery Protocol on distributed virtual switches. LLDP is the standards-based form of CDP, and an option on JunOS. You can configure LLDP on the switches by following Juniper’s documentation. You can enable LLDP in the advanced settings of your dvSwitch under “Discovery Protocol.”
VMware dvSwitch LLDP options are Listen, Advertise, or Both. Advertising means that network folks can see some information on their switches when they issue commands like “show lldp neighbors:”
user@switch> show lldp neighbors Local Interface Parent Interface Chassis Id Port info System Name ge-0/0/11.0 - port 917 on dvSwitch Production (etherswitch) esx-1.site.com ge-0/0/13.0 - port 915 on dvSwitch Production (etherswitch) esx-2.site.com ge-0/0/9.0 - port 913 on dvSwitch Production (etherswitch) esx-3.site.com ge-1/0/11.0 - port 918 on dvSwitch Production (etherswitch) esx-1.site.com ge-1/0/13.0 - port 916 on dvSwitch Production (etherswitch) esx-2.site.com ge-1/0/9.0 - port 914 on dvSwitch Production (etherswitch) esx-3.site.com
If you listen you just see the information coming from the switch:
Note that the port ID being displayed there doesn’t correspond to the ge* name of the port. It’s actually the SNMP Index of the port, which you can see with a JunOS “show lldp local-information” command. If you want to switch that to the ge* names just edit the port ID subtype, “port-id-subtype interface-name”. This appears to work on EX4200 10.4R12, though not on 10.4R10, and that document I’ve linked to only indicates that it works on MX, T, and PTX-series equipment. Regardless:
Ta-dum! Port ID is now ge-0/0/9 which is way more useful.
A big thanks goes out to my colleague Michael Hare for figuring the JunOS side of things out, being super cool about helping me to replicate what we had with CDP, and allowing me to write it up to augment the little LLDP information that is out there for VMware users.
 Documenting a physical layout like that usually violates my fundamental rule of not having non-authoritative sources of information around. A Visio diagram is not an authoritative source of the network configuration information, the network itself is. Besides, a diagram is handy but almost always wrong in some way, especially over time.
 LLDP isn’t supported on standard vSwitches, which is really annoying. Perhaps someone reading this can implore VMware to do the job correctly and put LLDP everywhere CDP is.
 The casual observer may note that SNMP index 528 isn’t ge-0/0/9. Yes, I did use two different switches/environments for these graphics, because by the time I decided that I should write this up one environment had already been altered. Second, I absolutely did not mess with the number of samples on that second port, it really was 31337.