VMware Cloud Community
MrBiscuit
Enthusiast
Enthusiast

How do I retrieve CDP information without querynetworkhint

I'm trying to add CDP information to a fast host configuration retrieval script for use during problem analysis at my company.

The common method for retrieving the information using PowerCli (kb1007069) is far too slow - for reference my script without CDP information collects storage, host, network and VM data from a very large environment in under 5mins, but adding CDP using the commond method takes nearly 30mins because of the additional get-view and querynetworkhint calls.

vCenter appears to keep a cache of the CDP information handy for when a user clicks on the more information button in the Configuration > Networking tab.

My question is, does anyone know how to retrieve this information?

Or is there a way to retrieve the vim.host.physicalnic.networkhint information via PowerCLI? (which returns very quickly on console)

Or is there another 'fast' way to retrieve CDP information?

Points for insightful information!

0 Kudos
3 Replies
maishsk
Expert
Expert

Have you tried with Get-EsxCli ?

But in your case

$esxcli = Get-EsxCli -VMHost $myhost

$esxcli.network.vswitch.standard.list()

Maish

VMTN Moderator | vExpert

Author of VMware vSphere Design

@maishsk | My Blog

Maish Saidel-Keesing • @maishsk • http://technodrone.blogspot.com • VMTN Moderator • vExpert • Co-author of VMware vSphere Design
0 Kudos
maishsk
Expert
Expert

My appologies - I see that this does not get the actual port information but if the CDP status is enabled or not.

This will not help you here..

Maish

Maish Saidel-Keesing • @maishsk • http://technodrone.blogspot.com • VMTN Moderator • vExpert • Co-author of VMware vSphere Design
0 Kudos
MrBiscuit
Enthusiast
Enthusiast

I'm sorry; I should've specified that i'm using PowerCLI version 4.1 against vCenter/ESXi 4.1u2

I believe the get-esxcli command requires individual connections to hosts? It's an interesting alternate method for gathering CDP information, but I'm looking for something that doesn't require individual server calls.

The kb method completes in 6 seconds per server when connected against multiple vCenters, but I'm collecting from 450 hosts, so I guess what I'm really after is the vCenter cache of the data.

I've already got a method which collects the data once per day and stores it in a metadata file for scripted use, but the idea of this collection script is to very quickly gather the current state for fault diagnosis.

0 Kudos