Enabling network hints on VMware ESX for CDP

Wednesday, July 8, 2009 by BBTUNA
If you've ever had to manually trace the multiple cat5e cables from ESX hosts to network switches you probably were not happy about it. The good news is that if you have ESX 3.5 and Cisco switches you can identify the switch ports that each VMNic is connected into by using Cisco Discovery Protocol (CDP). You won't even need access to the network switch and get all port information from the VI Client.

First we need to configure the host by logging into the Service Console as root (either by SSH, remote console, or physical access).
Next we need to verify current CDP settings for the desired virtual switch (vSwitch1 will be used in this post)
Type:
[root@server root]#esxcfg-vswitch -b vSwitch1 down (The output of down indicates CDP is currently not implemented)

Now set the CDP status for a given vSwitch (possible values are down, listen, advertise, or both) by typing:
[root@server root]#esxcfg-vswitch -B both vSwitch1

Verify the new settings by typing:
[root@server root]#esxcfg-vswitch -b vSwitch1 both

Be sure to repeat the commands for every vSwitch on the ESX host. Now using the VI Client you can go into the "Configuration" tab of a host and select "Networking" on the left pane. To the right of each vSwitch you find a comment looking box colored in a light blue. Clicking on the icon will brind up the switch port information.

Now lets say you want to extract CDP information for all VMNics at once. You can achieve this by going to the command line and typing:
[root@server root]#vmware-vim-cmd hostsvc/net/query_networkhint

Leave feedback in the comments. I would love to answer your questions if any arise.
Posted in | 0 Comments »

0 comments:

Post a Comment

About Me