TheVMinator
Expert
Expert

vLAN not showing in ESXi CDP output

Jump to solution

I have a vLAN that I am using in my environment and that is working fine between the ESXi host and the physical network.  However, when I run the command to show CDP information from the ESXi host, I don't see it.  I DO see other vlans that are also being used with no problem.  Why is this vLAN not showing in CDP output, but other vLANs are?

Thanks!

vim-cmd hostsvc/net/query_networkhint

(vim.host.PhysicalNic.NetworkHint) [

   (vim.host.PhysicalNic.NetworkHint) {

      dynamicType = <unset>,

      device = "vmnic0",

      subnet = (vim.host.PhysicalNic.NetworkHint.IpNetwork) [

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 401,

            ipSubnet = "10.40.11.32-10.40.11.63",

         },

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 1163,

            ipSubnet = "10.40.163.23-10.40.163.23",

         },

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 210,

            ipSubnet = "10.40.210.1-10.40.210.63",

         },

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 208,

            ipSubnet = "10.40.208.1-10.40.208.31",

         },

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 213,

            ipSubnet = "0.0.0.1-255.255.255.254",

         }

      ],

1 Solution

Accepted Solutions
Rubeck
Virtuoso
Virtuoso

What does seem to work for collecting VLAN info is to enable statistics on the vmnic level.. This seem to show all VLAN tags on the connected trunk. As a test I installed an ESXi 5.1U1 host, configured with a single NIC connected to a trunk port where only the a native VLAN were allowed along with a tagged one (VLAN5). No other VLANs are allowed on the pSwitch port.....

I then enabled the stats function on the vmnic.... (esxcli network nic vlan stats set -e true -n vmnic0)

I then pulled the stats from it to verify that only the native VLAN along with VLAN 5 are seen..

~ # esxcli network nic vlan stats get -n vmnic0

VLAN 0

   Packets received: 140

   Packets sent: 5

VLAN 5

   Packets received: 727

   Packets sent: 366

~ #

All good...

Then I configured the pSwitch port to be member of an additional VLAN.... VLAN 6. Didn't do anything on the host side..

Pulled the stats again..

~ # esxcli network nic vlan stats get -n vmnic0

VLAN 0

   Packets received: 243

   Packets sent: 8

VLAN 5

   Packets received: 979

   Packets sent: 431

VLAN 6

   Packets received: 14

   Packets sent: 0

~ #

Seems like the stat info is updated very fast in my quick test,..  Maybe this will help out in verifying VLANs available,..

/Rubeck

View solution in original post

9 Replies
Rubeck
Virtuoso
Virtuoso

Maybe there isn't enough broadcast packets on this specific network for the host(s) to detect it..?

See VMware KB: Observed IP range does not show network in ESX or ESXi

IMO, It really is hints only..

/Rubeck

0 Kudos
MKguy
Virtuoso
Virtuoso

I don't think this vim-cmd command queries actual CDP (or LLDP) information provided by your physical switch.

I rather think this info is derived from the old style "observed IP ranges" which you can see on physical NICs in the Configuration-Network Adapters view and elsewhere. It's based on passive sampling of traffic and as such isn't very reliable, especially with many VLANs.

I'm aware this KB article http://kb.vmware.com/kb/1007069 as well as some other articles (http://www.yellow-bricks.com/2011/09/18/cdp-information-using-the-commandline/) imply this is real CDP info, but if it provides me info on uplinks of standard vSwitches which physical switches do not support CDP and exactly the same unreliable stuff as I can see in the observed IP ranges (on dVS uplinks too), then I can't help but assume this is mistaken/a misunderstanding/a bug.

For example, this is the esxcfg-info output of an uplink that is attached to a standard vSwitch and a physical switch that does not support LLDP or CDP.

\==+Physical Nic :

            |----Name...............................................vmnic0

          [...]

            |----Network Hint.......................................11 10.10.9.200/255.255.255.248

          [...]

            |----Link Up............................................true

            |----enabled............................................true

            |----CDP Network........................................false

            |----LLDP Network.......................................false


# vim-cmd hostsvc/net/query_networkhint --pnic-name=vmnic0

(vim.host.PhysicalNic.NetworkHint) [

   (vim.host.PhysicalNic.NetworkHint) {

      dynamicType = <unset>,

      device = "vmnic0",

      subnet = (vim.host.PhysicalNic.NetworkHint.IpNetwork) [

         (vim.host.PhysicalNic.NetworkHint.IpNetwork) {

            dynamicType = <unset>,

            vlanId = 11,

            ipSubnet = "10.10.9.200-10.10.9.207",

         }

      ],

      connectedSwitchPort = (vim.host.PhysicalNic.CdpInfo) null,

      lldpInfo = (vim.host.PhysicalNic.LldpInfo) null,

You only get real CDP/LLDP uplink through distributed vSwitches. This is from an uplink on a dvSwitch that has LLDP enabled:

\==+Physical Nic :

            |----Name...............................................vmnic1

          [...]

            |----Network Hint.......................................71 10.20.10.229/255.255.255.255, 78 10.20.8.0/255.255.255.128, 77 169.254.89.75/255.255.255.255 [...]

            |----Link Up............................................true

            |----enabled............................................true

            |----CDP Network........................................false

            |----LLDP Network.......................................true

            \==+LLDP Summary :

               |----Chassis ID......................................xxxxxxxxxxxxxx

               |----Port ID.........................................14005

               |----Time-to-live....................................112

               |----Timeout.........................................0

               |----Samples.........................................2

               |----System Name.....................................xxxxxxxxxxxxx

-- http://alpacapowered.wordpress.com
TheVMinator
Expert
Expert

MKguy, I belive you are right.  I have seen this problem multiple times.  I think that the way ESXi is implmenting what it calls CDP is different than the way a Cisco switch implements it.  It is pulling information from packets somehow, but not the same way that a Cisco switch does.  I don't think ESXi is reliable as a source of all information that could be derived from CDP advertisements.  There definitely needs to be a fuller explanation from VMware on this.

As far as broadcast packets, CDP as a protocol is not supposed to have to rely on broadcast packets.  It is supposed to be able to get its information from CDP advertisements, which are in Cisco's customized format.  ESXi is either getting its information without reading the CDP advertisement packet, or it is getting incomplete information from the CDP advertisement.  Or perhaps since CDP advertisements only come at certain intervals such as 60 seconds, it isn't retaining the information long enough to give you accurate output.

0 Kudos
chriswahl
Virtuoso
Virtuoso

As mentioned earlier, the script that you are running is pulling in the "Observed IP Ranges" field from the NIC, which is next to worthless for getting an accurate read on a NIC. It will only show information when traffic is on the wire.

The only real value here is the fact that you can pull the CDP info off the switch (such as name, IP, MTU, etc.).

If using vSphere 5.1 with a VDS 5.1  you can use the Network Health Check to confirm that the upstream switch is configured properly.

http://wahlnetwork.com/2012/08/27/new-5-1-distributed-switch-features-part-1-network-health-check/

VCDX #104 (DCV, NV) ஃ WahlNetwork.com ஃ @ChrisWahl ஃ Author, Networking for VMware Administrators
TheVMinator
Expert
Expert

This is disappointing.  VMware specifically calls this "CDP".  Yet it does not in fact implement the true cisco discovery protocol either in the network health check or through any of the command line options available to ESXi.  I think this is misleading.  ESXi is not in fact capable of inspecting a CDP advertisement and pulling all the information from it.  Yet it says you have 3 options, "listen, advertise or both".  It makes it look just like a Cisco switch implmentation of CDP.  Yet it really is not.  It can't tell you all the information coming in on the switch advertisement packets.  If you come to the ESXi command line expecting ESXi "CDP" to give you the info that the CDP protocol is designed to, you will come away with an incomplete or wrong impression of how things are configured.

0 Kudos
MKguy
Virtuoso
Virtuoso

I'm not sure what exact kind of info CDP really provides, like if it contains a list of enabled VLANs in the link, but ESXi distributed vSwitches do in fact handle CDP/LLDP in both directions and can extract some information out of it. This is not implemented in the network health check function but separately from that.

You can see that in the esxcfg-info of my example above and in the network configuration section on the respective vmnic:

pastedImage_0.png

The vim-cmd networkhints command is just a misunderstood stepchild of the "observed IP ranges" which has been around since ages in that regard.

-- http://alpacapowered.wordpress.com
0 Kudos
TheVMinator
Expert
Expert

Looking further at the Cisco implmentation, perhaps I'm incorrect about it actually displaying a list of all of the vlans that are trunked on that link.  At first glance at the cisco command reference for NS-OX is appears not to:

http://www.cisco.com/web/techdoc/dc/reference/cli/nxos/commands/l2/show_cdp_neighbors.html

Here it seems to indicate that it will tell me what the native vlan is, but I don't see anywhere where it lists the vlans trunked on that link.

I may have gotten

"show cdp neighbors detail"

mixed up with

"show vlan":

http://www.cisco.com/en/US/docs/ios/lanswitch/command/reference/lsw_s2.html#wp1108095

and ESXi is giving more info than "show cdp neighbors detail" - ESXi is giving network hints, which aren't part of CDP anyway, and giving CDP info, which doesn't show the vlans trunked.

Perhaps the problem is that neither CDP nor network hints gives you all of the information about vlans truned on a link. 
When I ran esxcfg-info, it doesn't give you that information either.  There really is no mechanism to look into ESXi and know whether all the vlans that need to be trunked to the ESXi host have actually been trunked - you have to look at the physical switch.

For example here is esxcfg-info - but it doesn't list the vlans. Network hints had 4 networks which I took out for security but we actually have more than 8 trunked - and it only tells you the subnet range not the vlan ID for them:

|----Name...............................................vmnic0

            |----PCI Bus............................................4

            |----PCI Slot...........................................0

            |----PCI function.......................................0

            |----MAC Address........................................e8:39:35:28:d9:30

            |----Virtual MAC Address................................00:50:56:58:d9:30

            |----Driver.............................................be2net

            |----Network Hint.......................................

            |----MTU................................................1500

            |----Configured Speed...................................1000

            |----Actual Speed.......................................1000

            |----Configured Duplex..................................1

            |----Actual Duplex......................................1

            |----Link Up............................................true

            |----enabled............................................true

            |----Wake on LAN supported .............................false

            |----Wake on LAN enabled ...............................false

            |----Resource scheduler allowed  .......................true

            |----Resource scheduler supported ......................true

            |----CDP Network........................................true

            \==+CDP Summary :

               |----Cdp Version.....................................2

               |----Timeout.........................................0

               |----Time-to-live....................................143

               |----Samples.........................................41713

               |----Device Id.......................................

               |----Ip Address......................................

               |----Ip Prefix.......................................0.0.0.0/0

               |----Port Id.........................................GigabitEthernet1/0/16

               |----Capabilities....................................40

               |----Version.........................................unknown

               |----Platform........................................cisco WS-CBS3120X-S

               |----Vlan............................................1

               |----Duplex..........................................true

               |----MTU.............................................0

               |----System Name.....................................

               |----System OID......................................

               |----Mgmt Ip Address.................................

               |----Location........................................

            |----LLDP Network.......................................false

            \==+Hardware Capabilities :

               |----Vlan Tag........................................true

               |----Vlan Untag......................................true

               |----Checksum Offload................................true

               |----Tcp Segmentation Offload........................true

               |----Scatter Gather Tx...............................true

0 Kudos
Rubeck
Virtuoso
Virtuoso

What does seem to work for collecting VLAN info is to enable statistics on the vmnic level.. This seem to show all VLAN tags on the connected trunk. As a test I installed an ESXi 5.1U1 host, configured with a single NIC connected to a trunk port where only the a native VLAN were allowed along with a tagged one (VLAN5). No other VLANs are allowed on the pSwitch port.....

I then enabled the stats function on the vmnic.... (esxcli network nic vlan stats set -e true -n vmnic0)

I then pulled the stats from it to verify that only the native VLAN along with VLAN 5 are seen..

~ # esxcli network nic vlan stats get -n vmnic0

VLAN 0

   Packets received: 140

   Packets sent: 5

VLAN 5

   Packets received: 727

   Packets sent: 366

~ #

All good...

Then I configured the pSwitch port to be member of an additional VLAN.... VLAN 6. Didn't do anything on the host side..

Pulled the stats again..

~ # esxcli network nic vlan stats get -n vmnic0

VLAN 0

   Packets received: 243

   Packets sent: 8

VLAN 5

   Packets received: 979

   Packets sent: 431

VLAN 6

   Packets received: 14

   Packets sent: 0

~ #

Seems like the stat info is updated very fast in my quick test,..  Maybe this will help out in verifying VLANs available,..

/Rubeck

View solution in original post

TheVMinator
Expert
Expert

This is brilliant and works perfectly.  VMware needs to get this esxcli option better advertised.  I had never heard of it.  Thanks!

0 Kudos