PowerCLI Reference

Set-VDPortgroup

Synopsis

This cmdlet modifies the configuration of distributed port groups.

Syntax

Set-VDPortgroup [-Name <String>] [-Notes <String>] [-NumPorts <Int32>] [-VlanId <Int32>] [-VlanTrunkRange <VlanRangeList>] [-PrivateVlanId <Int32>] [-PortBinding <DistributedPortGroupPortBinding>] [-DisableVlan] [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-VDPortgroup -RollbackConfiguration [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-VDPortgroup -BackupPath <String> [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VDPortgroup
New-VDPortgroup
Remove-VDPortgroup
Export-VDPortgroup

Detailed Description

This cmdlet modifies the configuration of distributed port groups. You can set the properties of the distributed port group manually, provide a backup profile to import the port group configuration, or rollback to the last valid configuration.

Note: You can import or rollback a configuration only on vSphere 5.1 and later.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VDPortgroupVDPortgroup[]Specifies the distributed port group that you want to configure.truetrue (ByValue)
BackupPathStringSpecifies the full file path to the .zip file containing the backup configuration that you want to import. You can import only .zip files created with the Export-VDPortgroup cmdlet.

Note: This parameter is only supported on vSphere 5.1 and later.
truefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
DisableVlanSwitchParameterSets the VLAN type of the distributed port group to None. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.falsefalse
NameStringSpecifies a new name for the distributed port group that you want to configure.falsefalse
NotesStringSpecifies a new description for the distributed port group that you want to configure.falsefalse
NumPortsInt32Specifies a new number of ports on the distributed port group that you want to configure.falsefalse
PortBindingDistributedPortGroupPortBindingSpecifies a new port binding setting for the distributed port group that you want to configure. This parameter accepts Static, Dynamic, and Ephemeral values.

Note: Dynamic port binding is deprecated. For better performance, static port binding is recommended.
falsefalse
PrivateVlanIdInt32Specifies the secondary VLAN ID of a vSphere distributed switch's private VLAN configuration entry. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.falsefalse
RollbackConfigurationSwitchParameterIndicates that you want to rollback the distributed port group to its last valid configuration.

Note: Rollback is available only on vSphere 5.1 and later.
truefalse
RunAsyncSwitchParameterIndicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.falsefalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
VlanIdInt32Specifies a new VLAN ID for the distributed port group that you want to configure. The VLAN IDs of 0 and 4095 are reserved and cannot be used. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.falsefalse
VlanTrunkRangeVlanRangeListSpecifies a new VLAN trunk range for the distributed port group that you want to configure. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9". This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The modified VDPortgroup objects

Notes

Examples

-------------- Example 1 --------------

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -Name "MyNewVDPortGroupName" -NumPorts 5 -VlanId 4

Changes the name, number of ports and the VLAN ID of all distributed port groups named "MyVDPortGroup".

-------------- Example 2 --------------

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -VlanTrunkRange "1-5, 8-10"

Changes the VLAN trunk range of all distributed port groups named "MyVDPortGroup".

-------------- Example 3 --------------

$myVDPortgroup = Get-VDPortgroup -Name "MyVDPortGroup" -VDSwitch "MyVDSwitch"
Set-VDPortgroup -VDPortgroup $myVDPortgroup -DisableVlan

Sets the VLAN type of the specified distributed port group to None.

-------------- Example 4 --------------

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -RollbackConfiguration

Rollbacks the configuration of all distributed port groups named "MyVDPortGroup".

-------------- Example 5 --------------

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -BackupPath 'c:\backup.zip'

Reconfigures all distributed port groups named "MyVDPortGroup" by importing the configuration from the specified backup profile.


Copyright © VMware, Inc. All rights reserved.