paulcamit
Contributor
Contributor

powercli creating portgroups on DVS

i am trying to mass create portgroups on Distributed vSwitches with powercli, this is not a problem but setting it to Port Allocation Fixed seems to not be an option in the cmd-let. Is this something that has been put elsewhere?

1 Reply
LucD
Leadership
Leadership

No, no cmdlet for that.
But easy when using the API method.
For example

$vdSwName = 'MyVDSw'
$vdPgName = 'MyVDPg'

$pg = Get-VDPortgroup -Name $vdPgName -VDSwitch $vdSwName

$spec = New-Object VMware.Vim.DVPortgroupConfigSpec
$spec.ConfigVersion = $pg.ExtensionData.Config.ConfigVersion
$spec.AutoExpand = $false

$pg.EXtensionData.ReconfigureDVPortgroup($spec)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos