Friday, 15 January 2016

Unable To Delete vSwitch Or Remove Up-links from the vSwitch: A Specified Parameter Was Not Correct

Written by Suhas Savkoor



Today, I was working with a customer on a case where he had set up a new host and had configured a vSwitch for VM port-groups, vMotion and management, all on the same vSwitch. He also had created one additional switch and assigned couple of NICs to it. However, we did not need this vSwitch and we were trying to delete the vSwitch and we were being returned with an error. Removing the up-link, or even moving the up-link to unused state returned the same error. The error message was:

"A specified parameter was not correct. Vim.Host.VirtualSwitch.LinkDiscoveryProtocolConfig "

Resolution: (Applicable for 4.x and 5.x environment)

1. Take a SSH (Putty) session to this host.
2. Run the command:
# esxcfg-vswitch -B both <vSwitch> 
<vSwitch> is the name of the vSwitch which is returning the error.

The Switch -B has couple of values: 

-B --set-cdp Set the CDP status for a given virtual switch. To set pass one of "down", "listen", "advertise", "both"

"down" - means it will not participate in CDP
"listen" - means it will only listen for CDP
"advertise" - means it will advertise the CDP info
"both" - is a combination of listen and advertise

Any of the above parameters can be used

3. Refresh the network settings in the vSphere Client
4. Remove the up-links for the vSwitch. It should be now removed without any errors. 
5. Remove the vSwitch