Source : VMware KB and www.vmetc.com 
 
 
This is a handy little trick, 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:
Verify the current CDP setting for vSwitch2
ESX# esxcfg-vswitch -b vSwitch2
 
This is a handy little trick, 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:
Verify the current CDP setting for vSwitch2
ESX# esxcfg-vswitch -b vSwitch2
down 
The above output is down - which indicates CDP is  currently not enabled vSwitch2  To enable CDP on vSwitch2
ESX# esxcfg-vswitch -B both vSwitch2
To Verify the CDP Status (Expect -> Down, Listen, Advertise, Both)
ESX# esxcfg-vswitch  -b vSwitch2
Both
Check CDP information on Physical Switch
Once CDP support is enabled on the vSwitch & physical switch - execute below command on Phy.Switch. Which will show the link between each physical switch port and the matching ESX Server NIC. The output will look something like this:
# show cdp neighbor
Capability Codes: R-Router, T-Trans Bridge, B-Source Route Bridge
                  S-Switch, H-Host, I-IGMP, r-Repeater, P-Phone
DeviceID  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 CDP 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.
Check CDP information in VI Client
Now, using the VI Client you can go to the Configuration  tab of a host and select Networking. To the right of  each vSwitch is what I’ll describe as a dialogue icon.

Clicking this Call out icon (Green circle) brings up the switch port info you are seeking.

No comments:
Post a Comment
Note: Only a member of this blog may post a comment.