Syntax
New-VDPortgroup [-VDSwitch] <VDSwitch> -BackupPath <String> [-KeepIdentifiers] [-Name <String>] [-RunAsync] [-Server <VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet creates distributed port groups. You can create a new distributed port group with custom properties, specify a reference port group to clone its properties, or provide a backup profile to import the port group configuration.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
VDSwitch | VDSwitch | Specifies the vSphere distributed switch on which you want to create the new distributed port group. | true | True (ByValue) | |
BackupPath | String | Specifies the full file path to the .zip file containing the backup configuration that you want to import. Only .zip files created with the Export-VDPortgroup cmdlet are supported.
Note: This parameter is supported only on vSphere 5.1 and later. | true | False | |
Confirm | SwitchParameter | If 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. | false | False | |
KeepIdentifiers | SwitchParameter | Indicates that the original vSphere distributed port group identifiers will be preserved.
Note: This parameter is supported only on vSphere 5.1 and later. | false | False | |
Name | String | Specifies the name of the new distributed port group that you want to create. | true | False | |
Notes | String | Specifies a description for the new distributed port group that you want to create. | false | False | |
NumPorts | Int32 | Specifies the number of ports that the distributed port group will have. If you do not set this parameter, the number of ports for the new distributed port group is set to 128 ports. | false | False | |
PortBinding | DistributedPortGroupPortBinding | Specifies the port binding setting for the distributed port group that you want to create. This parameter accepts Static, Dynamic, and Ephemeral values. Note: Dynamic port binding is deprecated. For better performance, static port binding is recommended. | false | False | |
ReferencePortgroup | VDPortgroup | Specifies a reference distributed port group. The properties of the new distributed port group will be cloned from the reference distributed port group.
Note: This parameter is supported only on vSphere 5.1 and later. | true | True (ByValue) | |
RunAsync | SwitchParameter | Indicates 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. | false | False | |
Server | VIServer[] | 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. | false | False | |
VlanId | Int32 | Specifies the VLAN ID of the distributed port group that you want to create. Valid values are integers in the range of 1 to 4094. | false | False | |
VlanTrunkRange | VlanRangeList | Specifies the VLAN trunk range for the distributed port group that you want to create. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9". | false | False | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | False |
Return Type
The newly created VDPortgroup objectNotes
Examples
-------------------------- Example 1 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -NumPorts 8 -VLanId 4
Creates a new distributed port group on the specified vSphere distributed switch with the specified number of ports and VLAN ID.
-------------------------- Example 2 --------------------------
$myReferncePortroup = Get-VDPortgroup -Name "MyReferencePortGroup" Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -ReferencePortgroup $myReferncePortroup
Creates a new distributed port group on the specified vSphere distributed switch by cloning the configuration of the distributed port group named "MyReferencePortGroup".
-------------------------- Example 3 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -RunAsync
Creates asynchronously a new distributed port group on the specified vSphere distributed switch.
-------------------------- Example 4 --------------------------
$myBackupFilePath = 'c:\Backup.zip' Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortgroup" -BakupPath $myBackupFilePath
Creates a new distributed port group on the specified vSphere distributed switch by importing the specified backup profile.
-------------------------- Example 5 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -VlanTrunkRange "1-5, 10-20"
Creates a new distributed port group on the specified vSphere distributed switch with the specified name and VLAN trunk range settings.