New-SCLogicalNetworkDefinition

Creates a definition for a logical network that can be associated with one or more host groups.

Syntax

New-SCLogicalNetworkDefinition
   [-VMMServer <ServerConnection>]
   -Name <String>
   -LogicalNetwork <LogicalNetwork>
   -SubnetVLan <SubnetVLan[]>
   -VMHostGroup <HostGroup[]>
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

The New-SCLogicalNetworkDefinition cmdlet creates a definition for a Virtual Machine Manager (VMM) logical network. The logical network can be associated with one or more host groups. A logical network definition is also called a network site.

After you create a new logical network, use the logical network definition to assign IP subnets and virtual local area networks (VLANs) to the logical network. For information about creating logical networks, type: Get-Help New-SCLogicalNetwork -Detailed.

Examples

Example 1: Create a logical network definition for a logical network

PS C:\> $LogicalNetwork = Get-SCLogicalNetwork -Name "LogicalNetwork01"
PS C:\> $HostGroup =@()
PS C:\> $HostGroup += Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\HostGroup01" }
PS C:\> $Hostgroup += Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\HostGroup02\Production" }
PS C:\> $SubnetVLAN = @()
PS C:\> $SubnetVLAN += New-SCSubnetVLAN -Subnet 10.0.0.0/24 -VLAN 25
PS C:\> $SubnetVLAN += New-SCSubnetVLAN -Subnet FD4A:29CD:184F:3A2C::/64 -VLAN 25
PS C:\> New-SCLogicalNetworkDefinition -Name "Logical Network Definition 01" -LogicalNetwork $LogicalNetwork -VMHostGroup $HostGroup -SubnetVLAN $SubnetVLAN

The first command gets the logical network named LogicalNetwork01.

The second command creates a host group array and stores it in the $HostGroup variable.

The third and fourth commands retrieve the host groups named HostGroup01 and Production, and adds them to the $HostGroup array.

The fifth command creates a subnet VLAN array and stores it in the $SubnetVLAN variable.

The sixth and seventh commands create SubnetVLAN objects with the specified subnet and VLAN values and then stores the objects in the $SubnetVLAN array.

The final command creates a logical network definition named Logical Network Definition 01 for the logical network object stored in the $LogicalNetwork variable by using the objects stored in the $HostGroup and $SubnetVLAN arrays.

Parameters

-JobVariable

Specifies the name of a variable in which to track and store job progress.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LogicalNetwork

Specifies a logical network. A logical network is a named grouping of IP subnets and VLANs that is used to organize and simplify network assignments.

Type:LogicalNetwork
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a VMM object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubnetVLan

Specifies one or more IP subnet and VLAN sets.

For information about creating a SubnetVLan, type: Get-Help New-SCSubNetVLan.

Type:SubnetVLan[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VMHostGroup

Specifies a virtual machine host group object.

Type:HostGroup[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

LogicalNetworkDefiniton

This cmdlet returns a LogicalNetworkDefiniton object.

Notes

  • This cmdlet requires a VMM logical network object, which you retrieve by using the Get-SCLogicalNetwork cmdlet and a VMM host group object which you retrieve by using the Get-SCVMHostGroup cmdlet.