New-SCVMSubnet
New-SCVMSubnet
Creates a VM subnet.
Syntax
Parameter Set: WindowsNetworkVirtualization
New-SCVMSubnet [-Name] <String> [[-Description] <String> ] -SubnetVLan <SubnetVLan[]> -VMNetwork <VMNetwork> [-JobVariable <String> ] [-MaxNumberOfPorts <UInt32> ] [-PROTipID <Guid> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [-VMSubnetID <UInt32> ] [ <CommonParameters>]
Parameter Set: Vlan
New-SCVMSubnet [-Name] <String> [[-Description] <String> ] -LogicalNetworkDefinition <LogicalNetworkDefinition> -SubnetVLan <SubnetVLan[]> -VMNetwork <VMNetwork> [-JobVariable <String> ] [-MaxNumberOfPorts <UInt32> ] [-PROTipID <Guid> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: VMSubnetExternal
New-SCVMSubnet [-Name] <String> [[-Description] <String> ] -VMNetwork <VMNetwork> -VMSubnetExternal [-JobVariable <String> ] [-MaxNumberOfPorts <UInt32> ] [-PROTipID <Guid> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Detailed Description
The New-SCVMSubnet cmdlet creates a VM subnet. A VM subnet is an IP subnet that is associated with a VM network.
When you create a VM subnet, you must provide SubNetVLan and VMNetwork objects. To create the SubnetVLan object, use the New-SCSubnetVLan cmdlet. To obtain a VMNetwork object, use the Get-SCVMNetworkt cmdlet. The logical network used by the VM network must be enabled for network virtualization.
Parameters
-Description<String>
States a description for the specified object.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LogicalNetworkDefinition<LogicalNetworkDefinition>
Specifies a logical network definition (also called a network site) that contains the subnet that the IP address pool serves as specified by the Subnet parameter.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MaxNumberOfPorts<UInt32>
Specifies the maximum number of ports supported by the VM subnet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of a VMM object.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PROTipID<Guid>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SubnetVLan<SubnetVLan[]>
Specifies one or more IP subnet and VLAN sets.
For information about creating a SubnetVLan, type: "Get-Help New-SCSubNetVLan".
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMMServer<ServerConnection>
Specifies a VMM server object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-VMNetwork<VMNetwork>
Specifies a VM network object.
To get a VM network object, use the Get-SCVMNetwork cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMSubnetExternal
Indicates that the VM network is able to communicate with other networks.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMSubnetID<UInt32>
Specifies the ID of a VM subnet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
1: Create a VM subnet that uses NVGRE as the encapsulation mechanism.
The first command creates a subnet VLan object and stores the object in the $SubNetVLan variable.
The second command gets the VM network object named VMNetwork 01 and stores the object in the $VMNetwork variable.
The last command creates a VM subnet with the name VMSubnet01 using the subnet VLan stored in $SubnetVLan and the VM network stored in $VMNetwork.
PS C:\> $SubNetVLan = New-SCSubnetVLan -Subnet "192.168.3.0/24"
PS C:\> $VMNetwork = Get-SCVMNetwork -Name "VMNetwork01"
PS C:\> New-SCVMSubnet -Name "VMSubnet01" -SubnetVLan $SubnetVLan -VMNetwork $VMNetwork