Galapagos0424
Contributor
Contributor

Enabling CDP for Virtual Switches

Does anyone know if this can be done via an API call?

0 Kudos
9 Replies
akutz
Hot Shot
Hot Shot

I was not under the impression you had to make them CDP aware, and in fact I cannot find that option in the VI client. You can query CDP information about a PNIC via QueryNetworkHint. CDP is enabled upstream of the ESX server and the ESX kernel will receive the CDP info if it is being broadcast. At least that is my understanding.

0 Kudos
Galapagos0424
Contributor
Contributor

It can be enabled in the console with the following command "esxcfg-vswitch -B both <vswitchname>". "esxcfg-vswitch -b <vswitchname>" will return the status of CDP for the vSwitch.

0 Kudos
akutz
Hot Shot
Hot Shot

Thanks for the heads up! I cannot find anyway to set this via the SDK. Also, a "grep -iR cdp *" inside the remote cli directory does not reveal anything either, so it looks like this cannot be performed remotely and requires the console. This would indicate that ESXi does not support CDP. Can anyone verify this?

0 Kudos
Galapagos0424
Contributor
Contributor

The 3i config guide says that 3i by default has CDP enabled but in "listen" only mode. I verified this on a test 3i system. <sigh>

I guess I'll script using SSH to run the commands remotely in each host's SC...certainly not going to set it manually on 85 hosts with 3 vSwitches each Smiley Happy

0 Kudos
akutz
Hot Shot
Hot Shot

Since ESX3 defaults CDP to none, I am betting 3i defaults it to listen because there is no (easy) way to change it. I am betting it will be coming in the next version of the SDK. I will let the SDK guys know that this is needed functionality.

stumpr
Virtuoso
Virtuoso

From my experience with 3.5, the default is "listen" as well. I've found it useful from time to time, but usually considered best to disable CDP for security purposes. They're probably assuming listen mode is 'secure enough', which it probably is in most environments.

I haven't really spent much time with 3.5i. I just don't feel ready to step away from the Service Console when a lot of the advanced configurations and troubleshooting is still done within it's context.

I'd definitely like to see it in the SDK as well regardless.

r.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
stumpr
Virtuoso
Virtuoso

85 hosts...I'd be looking at tools like puppet, dsh, or cfengine! Smiley Happy

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
akutz
Hot Shot
Hot Shot

My 3.5 servers were set to none, but I bet that is because I upgraded them from 3. Interesting.

0 Kudos
stumpr
Virtuoso
Virtuoso

Mine were fresh installs 3.5.0-64607. Guess the upgrade defaults to none Smiley Happy

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos