Hello all,
I'm hoping one of the PowerCLI gurus out there can help me with a problem that's driving me nuts.
Ok, I see what you are trying to do.
I had a look, but it seems there is no documented method to change the MaxPort value of a proxyswitch.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The following should increase the number of ports.
You have to pass the ConfigVersion property to make the call.
And a reboot is indeed required
function Set-dvSwMaxPort{
param ($dvSw, $Ports)
$spec = New-Object VMware.Vim.VMwareDVSConfigSpec
$spec.ConfigVersion = $dvSw.ExtensionData.Config.ConfigVersion
$spec.MaxPorts = $Ports
$dvSw.ExtensionData.ReconfigureDvs($spec)
}
$dvSwitchName = "dvSw1"
$dvSw = Get-VirtualSwitch -Name $dvSwitchName -Distributed
Set-dvSwMaxPort -dvSw $dvSw -Ports 256
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc,
Thanks for taking the time to assist ... unfortunately it doesnt achieve what I'm aiming for, which is to increase the maximum allocation of DVS proxy switch ports on a given host which is already attached to a DVS. You can interrogate the DVS proxy switches at the ESX shell using net-dvs:
Ok, I see what you are trying to do.
I had a look, but it seems there is no documented method to change the MaxPort value of a proxyswitch.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc thanks once again for your time on this issue. I've got down and dirty with this and started attacking the problem from the VC database angle:
It seems to have worked. Pretty ugly solution though, and it's effectiveness is not proven (I'm not in a position to test the port limit yet).
There must be a better PowerCLI way though surely? I did some further digging via the VC mob browser (http://vc/mob/) and it would seem that the VMwareDVSConfigInfo object contains an array of DistributedVirtualSwitchHostMember objects, in which the maxProxySwitchPorts property is defined. Surely if this property were to be set to an appropriate value for all the DVS-attached hosts and then the ReconfigureDvs_Task() method called it would get the job done?
Borrowing some of (your?) DVS cmdlet code from the PowerCLI Reference, I crafted a new cmdlet (see attached file) to do exactly that and ... it worked. Interestingly, unlike the manual steps above, the new max ports value is immediately propagated out to the host from VC so there's no need to restart VC etc, but I'm guessing that a host reboot is still required to make the change effective.
Since the majority of the code is from your co-authored book, I'm going to assign full points for the assist
Jason D
Thanks for sharing, I must have missed that one.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
How can I change this value for a host deployed using autodeploy. setting will not be persistent after stateless host reboot..
any help much appreciated