Share via


Set-SCVMHostNetworkAdapter

Set-SCVMHostNetworkAdapter

Changes network-related properties for a physical network adapter on a host managed by VMM.

Syntax

Parameter Set: LogicalNetwork
Set-SCVMHostNetworkAdapter [-VMHostNetworkAdapter] <HostNetworkAdapter> [-AddOrSetLogicalNetwork <LogicalNetwork> ] [-AvailableForPlacement <Boolean]> ] [-Description <String> ] [-EnableNetworkVirtualization <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RemoveLogicalNetwork <LogicalNetwork> ] [-RemoveUnassignedVLan <UInt16[]> ] [-RemoveUplinkPortProfileSet] [-RunAsynchronously] [-SubnetVLan <SubnetVLan[]> ] [-UplinkPortProfileSet <UplinkPortProfileSet> ] [-UsedForManagement <Boolean]> ] [-VLanMode <VlanMode]> ] [ <CommonParameters>]

Parameter Set: Manual
Set-SCVMHostNetworkAdapter [-VMHostNetworkAdapter] <HostNetworkAdapter> [-AvailableForPlacement <Boolean]> ] [-Description <String> ] [-EnableNetworkVirtualization <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RemoveUnassignedVLan <UInt16[]> ] [-RemoveUplinkPortProfileSet] [-RunAsynchronously] [-UplinkPortProfileSet <UplinkPortProfileSet> ] [-UsedForManagement <Boolean]> ] [-VLanEnabled <Boolean]> ] [-VLanID <UInt16]> ] [-VLanMode <VlanMode]> ] [-VLanTrunkID <UInt16[]> ] [ <CommonParameters>]

Detailed Description

The Set-SCVMHostNetworkAdapter cmdlet changes network-related properties for a physical network adapter on a host managed by Virtual Machine Manager (VMM).

Properties that you can change with this cmdlet include:

-- VLAN Settings. You can use the VLAN parameters to create or modify a single VLAN or multiple VLANs.

For more information about VLANs and additional examples that illustrate VLAN settings, type Get-Help Add-SCVMHostNetworkAdapter -detailed.

Parameters

-AddOrSetLogicalNetwork<LogicalNetwork>

Specifies a logical network that this cmdlets adds or updates.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AvailableForPlacement<Boolean]>

Indicates whether the VMM placement process considers this host or this volume on a host to be eligible as a possible location on which to deploy virtual machines. If this parameter is $False, you can choose to deploy virtual machines on this host or volume anyway. The default value is $True. This parameter does not apply to VMware ESX hosts.

When this parameter is used with network adapters, if set to $False, then placement is not consider the logical networks configured on this network adapter to determine if the host is suitable for connecting a virtual machine.

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

-EnableNetworkVirtualization<Boolean]>

Indicates whether network virtualization is enabled. The default value is $False.

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 runs as a set just before the final command that includes the same job group identifier runs.

Aliases

none

Required?

false

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

-PROTipID<Guid]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveLogicalNetwork<LogicalNetwork>

Specifies a logical network that this cmdlet removes.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveUnassignedVLan<UInt16[]>

Specifies that the specified VLANs that this cmdlet removes from the VLAN trunk of the adapter if they are not associated with a logical network.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveUplinkPortProfileSet

Indicates that this cmdlet removes the uplink port profile set from the host network adapter.

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?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UplinkPortProfileSet<UplinkPortProfileSet>

Specifies an uplink port profile set object.

To obtain an uplink port profile set object, use the Get-SCUplinkPortProfileSet cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UsedForManagement<Boolean]>

Indicates whether the object is used to manage hosts.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VLanEnabled<Boolean]>

Indicates whether the cmdlet enables a virtual LAN (VLAN) for use by virtual machines on a Hyper-V or Citrix XenServer host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VLanMode<VlanMode]>

Specifies whether a VLAN on a virtual machine host supports traffic across a single VLAN (Access mode) or across multiple VLANs (Trunk mode). Valid values are: Access and Trunk.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VLanTrunkID<UInt16[]>

Assigns a list of numerical identifiers in the range 1-4094 to a physical network adapter on a Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostNetworkAdapter<HostNetworkAdapter>

Specifies a physical network adapter object on a host to which virtual machines deployed on that host can connect.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

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.

  • VMHostNetworkAdapter

Examples

Example Example 1: Create a new virtual network on a host network adapter

The first command gets the host object named VMHost02, and then stores the object in the $VMHost variable.

The second command gets the host network adapter object with a name that begins with Intel(R) PRO/1000 on VMHost02, and then stores the object in the $HostAdapter variable.

The third command creates a virtual network named VirtualNetwork01 on VMHost02 that is bound to the host adapter stored in $HostAdapter.

The last command enables a VLAN, assigns the network adapter a VLanID of 35, and sets the mode to Access. Setting the mode to Access routes traffic internally within a single VLAN.

This example assumes that your host is already connected to a VLAN or, if not, 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 prevents VMM from managing the host.

PS C:\> $VMHost = Get-SCVMHost -Computername "VMHost02.Contoso.com"
PS C:\> $HostAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost |  where {$_.Name -like "Intel(R) PRO/1000*" }
PS C:\> New-SCVirtualNetwork -Name "VirtualNetwork01" -VMHost $VMHost -VMHostNetworkAdapter $HostAdapter
PS C:\> Set-SCVMHostNetworkAdapter -VMHostNetworkAdapter $HostAdapter -VLanEnabled $True -VLanMode "Access" -VLanID 35

Example 2: Add VLALan tags to a host network adapter configured in Trunk mode

The first command gets the host object named VMHost03, and then stores the object in the $VMHost variable.

The second command gets the host network adapter object by specifying the adapter name, and then stores the object in the $VMHostNIC variable.

The third command uses the VlanTags property of the host network adapter object, and concatenates a new array of tags. The updated array retains the existing VlanTags and adds the listed tags to the array. The result of the concatenation is stored in $NewVlanTags.

The last command passes the new list of VLAN tags to the VLANTrunkID parameter of Set-VMHostNetworkAdapter. The VLanMode parameter must specify the value Trunk whenever the VLANTrunkID parameter is used to modify the list of VLAN trunk numerical identifiers.

PS C:\> $VMHost = Get-SCVMHost -Computername "VMHost03.Contoso.com"
PS C:\> $VMHostNIC = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "Adapter #3"
PS C:\> $NewVlanTags = $VMHostNIC.VlanTags + @(177,355,1012)
PS C:\> Set-SCVMHostNetworkAdapter -VMHostNetworkAdapter $VMHostNIC -VLANEnabled $TRUE -VLanMode "Trunk" -VLanTrunkID $NewVLanTags

Add-SCVMHostNetworkAdapter

Get-SCVMHostNetworkAdapter

New-SCVirtualNetwork

New-SCVirtualNetworkAdapter

Remove-SCVMHostNetworkAdapter

Set-SCVirtualNetwork

Set-SCVirtualNetworkAdapter

Get-SCVMHost