New-SCVirtualNetwork
New-SCVirtualNetwork
Creates a virtual network on a host managed by VMM over which virtual machines on that host can communicate.
Syntax
Parameter Set: NewCluster
New-SCVirtualNetwork [-Name] <String> -JobGroup <Guid]> -LogicalNetwork <LogicalNetwork[]> [-BoundToVMHost <Boolean]> ] [-Description <String> ] [-HostBoundVLanId <UInt16]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]
Parameter Set: Cluster
New-SCVirtualNetwork [-Name] <String> -LogicalNetwork <LogicalNetwork[]> -VMHostCluster <HostCluster> [-BoundToVMHost <Boolean]> ] [-Description <String> ] [-HostBoundVLanId <UInt16]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]
Parameter Set: Host
New-SCVirtualNetwork [-Name] <String> -VMHost <Host> [-BoundToVMHost <Boolean]> ] [-Description <String> ] [-HostBoundVLanId <UInt16]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMHostNetworkAdapters <HostNetworkAdapter[]> ] [ <CommonParameters>]
Parameter Set: LogicalSwitch
New-SCVirtualNetwork -LogicalSwitch <LogicalSwitch> -VMHost <Host> [-CreateManagementAdapter] [-Description <String> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-ManagementAdapterName <String> ] [-ManagementAdapterPortClassification <PortClassification> ] [-ManagementAdapterVLanId <UInt16]> ] [-ManagementAdapterVMNetwork <VMNetwork> ] [-ManagementAdapterVMSubnet <VMSubnet> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMHostNetworkAdapters <HostNetworkAdapter[]> ] [ <CommonParameters>]
Detailed Description
The New-SCVirtualNetwork cmdlet creates a virtual network on a host managed by Virtual Machine Manager (VMM) over which virtual machines on that host can communicate.
System Center 2012 - VMM supports the use of virtual switches to implement virtual networking scenarios for Hyper-V and Citrix XenServer hosts. You can connect, or bind, virtual machines and hosts to a virtual network switch in a manner similar to the way that you connect physical computers to a physical network switch.
For Hyper-V hosts, and the virtual machines deployed on these hosts, VMM also supports the use of virtual switches to implement virtual local area networks (VLANs). A VLAN is an independent logical virtual network configured within a physical LAN. If you create multiple VLANs on a physical LAN, these separate logical segments cannot exchange data with each other.
For XenServer hosts, all virtual switches attached to a single network adapter on a XenServer host are represented as a single virtual network within VMM.
In VMM for System Center 2012, you can easily move a virtual machine that is connected to a VLAN from one host to another host and, assuming that both hosts are connected to the same VLAN, the virtual machine in its new location is already configured to resume communicating over the VLAN without any additional administrator effort. Moving a virtual machine to a new location on a VLAN does not require software reconfiguration in the way that moving a physical computer to a new location on a physical network requires hardware reconfiguration.
The following three scenarios summarize VMM for System Center 2012 virtual networking configurations:
-- Scenario 1. External Virtual Network.
In this scenario, virtual machines deployed on a host use a virtual network adapter to connect to a virtual switch on the host, and this virtual switch is, in turn, connected to a physical network adapter on the host. The host is connected through a physical switch to other computers on its network. This configuration gives the virtual machines access to the host itself, to the physical network to which the host is connected, and to other physical computers, or other physical devices, that are on the same physical network as the host.
The virtual network can support external access though a VLAN if the physical adapter on the host that it is bound to has been configured appropriately and if the virtual machines on that host are configured to use a VLAN. For more information, type Get-Help Add-SCVMHostNetworkAdapter -detailed
, or Get-Help New-SCVirtualNetworkAdapter -detailed
.
-- Scenario 2. Internal Virtual Network.
In this scenario, virtual machines deployed on a host use a virtual network adapter to connect to a virtual switch on the host. In this scenario, the virtual network is bound to the host but the virtual machines do not connect via the virtual switch to a physical network adapter on the host. This configuration establishes an internal virtual network that enables virtual machines connected to that virtual switch to communicate with each other and with services and applications on the host, but not with other computers connected to the host's physical network.
If you want to configure an internal network that is separated into two or more VLANs, you must set the VLAN IDs on a virtual network adapter configured on the virtual machine object. For more information, type Get-Help New-SCVirtualNetworkAdapter -detailed
, Get-Help Set-SCVirtualNetworkAdapter -detailed
, or Get-Help Set-SCVMHostNetworkAdapter -detailed
.
-- Scenario 3. Private Virtual Network.
In this scenario, virtual machines deployed on a host use a virtual network adapter to connect to a virtual switch on the host. As in scenario 2, a virtual machine does not connect via that virtual switch to a physical network adapter on the host. Unlike scenario 2, the virtual network is not bound to the host. This configuration establishes a private virtual network that virtual machines on the same host can use to communicate with each other, but, in this case, they cannot communicate with services or applications on the host or with any physical computers connected to the host's physical network.
Parameters
-BoundToVMHost<Boolean]>
Indicates whether a virtual network is bound to a host. Binding a virtual network to a host enables network communication to the host.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CreateManagementAdapter
Indicates that the cmdlet creates the management adapter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Description<String>
States a description for the specified object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-HostBoundVLanId<UInt16]>
Assigns a VLAN to the virtual network adapter that was created for the host for the specified virtual network.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-JobGroup<Guid]>
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
Aliases |
none |
Required? |
true |
Position? |
named |
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 |
-LogicalNetwork<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.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LogicalSwitch<LogicalSwitch>
Specifies a logical switch object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-ManagementAdapterName<String>
Specifies a name for the management adapter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ManagementAdapterPortClassification<PortClassification>
Specifies a port classification for the management adapter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ManagementAdapterVLanId<UInt16]>
Specifies a VLAN ID for the management adapter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ManagementAdapterVMNetwork<VMNetwork>
Specifies a VM network for the management adapter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ManagementAdapterVMSubnet<VMSubnet>
Specifies a VM subnet for the management adapter.
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 |
-VMHost<Host>
Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.
For more information about each type of host, type Get-Help Add-SCVMHost -detailed
. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-VMHostCluster<HostCluster>
Specifies a VMM host cluster object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMHostNetworkAdapters<HostNetworkAdapter[]>
Specifies an array of one or more physical network adapter objects on a host to which virtual machines deployed on that host can connect.
Example format: -VMHostNetworkAdapters $VMHostNICs
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.
- VirtualNetwork
Examples
Example 1: Create an external virtual network on a host
The first command gets the host object named VMHost01, and then stores the object in the $VMHost variable.
The second command gets the physical host network adapter object named HostLANAdapter01 on VMHost01, and then stores the object in the $HostAdapter variable.
The third command creates a virtual network on VMHost01 named ExternalVirtualNetwork01, and connects the new virtual network to the host network adapter HostLANAdapter01.
This virtual network is an external virtual network. It is attached to the physical network adapter on the host and can therefore access the LAN that the host is attached to as if it were another physical computer on that LAN.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $HostAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostLANAdapter01"
PS C:\> New-SCVirtualNetwork -Name "ExternalVirtualNetwork01" -VMHost $VMHost -VMHostNetworkAdapter $HostAdapter
Example 2: Create an internal host-bound virtual network
The first command gets the host object VMHost01, and then stores the object in the $VMHost variable.
The second command creates a virtual network on VMHost01, names it InternalVNet01, specifies a description and tag, and binds the virtual network to the physical host.
This virtual network is an internal, host-bound virtual network. Because it is not attached to a physical network adapter on the host, it cannot access networks external to the host. Virtual machines that are connected to this internal virtual network on this host can communicate only with each other. Because the network is bound to the host, network communication from virtual machines to the host is also possible.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> New-SCVirtualNetwork -VMHost $VMHost -Name "InternalVNet01" -Description "Internal Host-Bound Virtual Network" -BoundToVMHost $True
Example 3: Create a private virtual network that is not bound to the host
The first command gets the host object named VMHost01, and then stores the object in the $VMHost variable.
The second command creates a virtual network on VMHost01 named UnboundVirtualNetwork01.
Because the network is not attached to a physical network adapter on the host, it cannot access networks external to the host. Virtual machines that are connected to this internal virtual network on this host can communicate only with each other. Because the virtual network is not bound to the host, network communication to the host is not possible.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> New-SCVirtualNetwork -Name "UnboundVirtualNetwork01" -VMHost $VMHost