Today I was playing around with the vSphere Distributed Switch and trying to reach the configuration maximums of it by creating lots of dvPortgroups. But when I reached the port numbers above 8192, the dvPortgroup wasn’t created and I got the following error:
From KB1038193 I used the resolution to change the default max numPorts from 8192 to 20000. The 20000 value is also the one mentioned in the Configuration Maxium document: vsp_41_config_max.pdf so I don’t know why VMware used the 8192 max value. If anyone can explain why this extra limit if effective, please let me know.
The solution from KB1038193:
Symptoms
- You cannot configure more than 8192 virtual ports in vCenter Server vNetwork Distributed Switch (vDS).
- You see the error:
The numPorts value : 8256 in spec exceeded maxPorts 8192.Purpose
This article provides steps to increase the maximum number of vDS ports.
Resolution
Changing the maximum number of vDS ports by using vSphere PowerCLI
vSphere PowerCLI can be used to automate the different virtual machine tasks. It provides an easy-to-use C# and PowerShell interface to VMware vSphere APIs. For more information, see the VMware vSphere PowerCLI Documentation.
To change the maximum number of vDS ports, you can use this PowerCLI snippet:
$dvs = Get-VirtualSwitch -Distributed -Name DVSName | Get-View
$cfg = New-Object -TypeName VMware.Vim.DVSConfigSpec
$cfg.MaxPorts = 20000
$cfg.configVersion = $dvs.config.configVersion
$dvs.ReconfigureDvs_Task( $cfg )
I have changed the code slightly to report the current configuration. you can use this script or the one from the KB article:
# dvSwitchName $dvSwitchName = "dvSwitch01" $dvs = Get-VirtualSwitch -Distributed -Name $dvSwitchName | Get-View Write-Host "The current configuration of MaxPorts = $($dvs.Config.MaxPorts)" -for Yellow $cfg = New-Object -TypeName VMware.Vim.DVSConfigSpec # Org #$cfg.MaxPorts = 8192 # New $cfg.MaxPorts = 20000 $cfg.configVersion = $dvs.config.configVersion $dvs.ReconfigureDvs_Task( $cfg ) | Out-Null # Report new configuration $dvs = Get-VirtualSwitch -Distributed -Name $dvSwitchName | Get-View Write-Host "The new configuration of MaxPorts = $($dvs.Config.MaxPorts)" -for Green
Output:
Source: KB1038193