Add-SCVMHostNetworkAdapter
Add-SCVMHostNetworkAdapter
Adds a physical network adapter on a host managed by VMM to a virtual network.
構文
Parameter Set: Default
Add-SCVMHostNetworkAdapter [-VMHostNetworkAdapter] <HostNetworkAdapter> -VirtualNetwork <VirtualNetwork> [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VLanEnabled] [-VLanID <UInt16]> ] [-VLanMode <VlanMode]> ] [-VLanTrunkID <UInt16[]> ] [ <CommonParameters>]
詳細説明
The Add-SCVMHostNetworkAdapter cmdlet adds a physical network adapter, also called a network interface card, or NIC, on a host managed by Virtual Machine Manager (VMM) to a virtual network. Each virtual machine on that host can also connect through a virtual network adapter to that virtual network.
A virtual network configured on a host can connect to multiple virtual network adapters on virtual machines deployed on that host.
System Center 2012 - VMM includes virtual networking support for configuring one or more virtual local area networks (VLANs) on a host. You can use the Add-SCVMHostNetworkAdapter cmdlet or the Set-SCVMHostNetworkAdapter cmdlet to configure a single VLAN or multiple VLANs on a host. To configure corresponding VLAN settings on a virtual machine, use the New-SCVirtualNetworkAdapter cmdlet or the Set-SCVirtualNetworkAdapter cmdlet.
For an illustration of each type of VLAN, see the examples for this cmdlet.
パラメーター
-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.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PROTipID<Guid]>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VirtualNetwork<VirtualNetwork>
Specifies a virtual network object.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-VLanEnabled
Indicates whether the cmdlet enables a virtual LAN (VLAN) for use by virtual machines on a Hyper-V or Citrix XenServer host.
Example format for a single VLAN: -VLanEnabled $True -VLanMode "Access" -VLanID 35
Example format for multiple VLANs: -VLanEnabled $True -VLanMode "Trunk" -VLanTrunkID 1,2,100,200,1124
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VLanID<UInt16]>
Assigns a numerical identifier in the range 1-4094 to a virtual network adapter on a virtual machine or to a physical network adapter on a virtual machine host.
Configure a VLanID on a Hyper-V, VMware ESX, or Citrix XenServer host:
-- On an externally bound physical network adapter when the VLan mode is Access.
Configure a VLanID on a virtual network adapter of a virtual machine:
-- Bound to a physical network adapter on the host, or
-- Bound to an internal virtual network on the host.
Example format: -VLanEnabled $True -VLanMode "Access" -VLanID 35
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VLanMode<VlanMode]>
Specifies whether a virtual LAN (VLAN) on a virtual machine host supports traffic across a single VLAN (Access mode) or across multiple VLANs (Trunk mode). Valid values are: Access, Trunk.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VLanTrunkID<UInt16[]>
Assigns a list of numerical identifiers in the range 1-4094 to a physical network adapter on a Hyper-V host.
Example format: -VLanEnabled $True-VLanMode "Trunk" -VLanTrunkID 1,2,100,200,1124
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VMHostNetworkAdapter<HostNetworkAdapter>
Specifies a physical network adapter object on a host to which virtual machines deployed on that host can connect.
Example format: -VMHostNetworkAdapter $VMHostNIC
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- VMHostNetworkAdapter
例
Example 1: Add a physical host network adapter to a virtual network
The first command gets the host object named VMHost01, and then stores the object in the $VMHost variable.
The second command gets the virtual network object named ExternalVirtualNetwork01 on VMHost01, and then stores the object in the $VirtualNetwork variable.
The third command gets the physical network adapter object named HostAdapter01 on VMHost01, and then stores the object in the $VMHostNetworkAdapter variable.
The last command adds HostAdapter01 to ExternalVirtualNetwork01.
You can add only one physical host adapter per virtual network. Therefore, the last command will fail if an adapter is already associated with the specified virtual network. To add a new adapter to the virtual network, you must first remove the existing host adapter.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $VirtualNetwork = Get-SCVirtualNetwork -VMHost $VMHost -Name "ExternalVirtualNetwork01"
PS C:\> $VMHostNetworkAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostAdapter01"
PS C:\> Add-SCVMHostNetworkAdapter -VirtualNetwork $VirtualNetwork -VMHostNetworkAdapter $VMHostNetworkAdapter
Example Example 2: Add a physical host network adapter to a VLAN that uses "Trunk" mode.
The first command gets the host object named VMHost02, and then stores the object in the $VMHost variable.
The second command gets the virtual network object named ExternalNetwork02 on VMHost02, and then stores the object in the $VirtualNetwork variable.
The third command gets the network adapter object named HostAdapter02 on VMHost02, and then stores the adapter object in the $VMHostNetworkAdapter variable.
The last command adds HostAdapter02 to virtual network ExternalNetwork02 and enables access from ExternalNetwork02 to an external networking device using 802.1Q tagged VLANs 1, 2, 100, 200, and 1124.
You can add only one host adapter per virtual network, so the last command will fail if an adapter is already associated with the specified virtual network.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02"
PS C:\> $VirtualNetwork = Get-SCVirtualNetwork -VMHost $VMHost -Name "ExternalNetwork02"
PS C:\> $VMHostNetworkAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostAdapter02"
PS C:\> Add-SCVMHostNetworkAdapter -VirtualNetwork $VirtualNetwork -VMHostNetworkAdapter $VMHostNetworkAdapter -VLANEnabled -VLANMode "Trunk" -VLANTrunkID 1,2,100,200,1124
Example Example 3: Add a physical host network adapter to a VLAN that uses "Access" mode.
The first command gets the host object named VMHost03, and then stores the object in the $VMHost variable.
The second command gets the virtual network object named ExternalNetwork03 on VMHost03, and then stores the object in the $VirtualNetwork variable.
The third command gets the network adapter object named HostAdapter03 on VMHost03, and then stores the adapter object in the $VMHostNetworkAdapter variable.
The last command adds HostAdapter03 to virtual network ExternalNetwork03 and restricts access to ExternalNetwork03 to VLANID 22.
You can add only one host adapter per virtual network, so the last command will fail if an adapter is already associated with the specified virtual network.
CAUTION: This example assumes that that your host is already connected to a VLAN or, if not, ensure that your host has two network adapters. If your host has a single network adapter, assigning the adapter to a VLAN that is unavailable to the VMM server will prevent VMM from managing the host. You can perform the steps in this example on a host that has only one network adapter if you first install the Microsoft Loopback Adapter on your server.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost03.Contoso.com"
PS C:\> $VirtualNetwork = Get-SCVirtualNetwork -VMHost $VMHost -Name "ExternalVirtualNetwork03"
PS C:\> $VMHostNetworkAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostAdapter03"
PS C:\> Add-SCVMHostNetworkAdapter -VirtualNetwork $VirtualNetwork -VMHostNetworkAdapter $VMHostNetworkAdapter -VLanEnabled -VLanMode "Access" -VLanID 22