This is more of a quick one for reference as there are numerous articles on this in the blogosphere. Enabling Cisco CDP on your vSwitch’s is fantastic for troubleshooting NIC problems and Documentations. As Cisco CDP is enabled by default on most devices all you need to do from the ESX side is the following.
From the command line of your ESX host run the following command for each vSwitch
esxcfg-vswitch –B both vSwitch0
Now when you view the vSwitch configuration on your ESX host you will be able to see more information about the physical switchthe host is connected to, including switch name and most importantly the switch port number.
If you login to your cisco switch and run the following command
show cdp entry *
You will then be able to see the reserve of this information from the Cisco switch itself, very usefully when diagnosing networking or cabling issues.
My next step is to write a powershell script that will grab the information from ESX and document it. Watch this space.