Поделиться через


New-SCLogicalNetworkDefinition

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

Syntax

Default (Default)

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:LogicalNetwork
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a VMM object.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubnetVLan

Specifies one or more IP subnet and VLAN sets.

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

Parameter properties

Type:

SubnetVLan[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMHostGroup

Specifies a virtual machine host group object.

Parameter properties

Type:

HostGroup[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a VMM server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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.