Editar

Compartilhar via


Set-VmNetworkAdapterIsolation

Modifies isolation settings for a virtual network adapter.

Syntax

Set-VmNetworkAdapterIsolation
   [-VMNetworkAdapterName <String>]
   [-CimSession <CimSession[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential[]>]
   [-VMName] <String[]>
   [-IsolationMode <VMNetworkAdapterIsolationMode>]
   [-AllowUntaggedTraffic <Boolean>]
   [-DefaultIsolationID <Int32>]
   [-MultiTenantStack <OnOffState>]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-VmNetworkAdapterIsolation
   [-VMNetworkAdapter] <VMNetworkAdapterBase[]>
   [-IsolationMode <VMNetworkAdapterIsolationMode>]
   [-AllowUntaggedTraffic <Boolean>]
   [-DefaultIsolationID <Int32>]
   [-MultiTenantStack <OnOffState>]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-VmNetworkAdapterIsolation
   [-ManagementOS]
   [-VMNetworkAdapterName <String>]
   [-CimSession <CimSession[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential[]>]
   [-IsolationMode <VMNetworkAdapterIsolationMode>]
   [-AllowUntaggedTraffic <Boolean>]
   [-DefaultIsolationID <Int32>]
   [-MultiTenantStack <OnOffState>]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-VmNetworkAdapterIsolation
   [-VMNetworkAdapterName <String>]
   [-VM] <VirtualMachine[]>
   [-IsolationMode <VMNetworkAdapterIsolationMode>]
   [-AllowUntaggedTraffic <Boolean>]
   [-DefaultIsolationID <Int32>]
   [-MultiTenantStack <OnOffState>]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-VmNetworkAdapterIsolation cmdlet modifies isolation settings for a virtual network adapter. You can isolate a virtual machine adapter by using virtual local area network (VLAN), Hyper-V Network Virtualization or a third party virtualization solution. You can specify the isolation method and modify other settings, which include multitenancy settings. For more information about multitenancy, see the Add-VmNetworkAdapterRoutingDomainMapping cmdlet.

Examples

Example 1: Set isolation mode for a virtual machine

PS C:\> Set-VMNetworkAdapterIsolation -VMName "TSQA01" -AllowUntaggedTraffic $False -IsolationMode NativeVirtualSubnet -MultiTenantStack On

This command sets the isolation mode of the virtual machine named TSQA01 to NativeVirtualSubnet, which indicates Hyper-V Network Virtualization. The virtual machine does not accept untagged traffic, but the MultitenantStack parameter has a value of On, so the virtual machine can provide services to multiple tenants.

Example 2: Set isolation mode and untagged traffic setting for a virtual machine

PS C:\> Set-VMNetworkAdapterIsolation -VMName "TSQA01" -AllowUntaggedTraffic $True -IsolationMode VLAN -DefaultIsolationID 1 -MultiTenantStack On

This command sets the isolation mode for virtual machine named TSQA01 to be VLAN. The virtual machine accepts untagged traffic, which is sent and received on VLAN 1, specified by the DefaultIsolationID parameter. Untagged traffic goes to the default compartment in the virtual machine. Multitenancy is enabled, therefore, the virtual machine receives isolation subnet and routing domain information.

Parameters

-AllowUntaggedTraffic

Indicates whether the virtual machine sends and receives untagged traffic.

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

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

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

-ComputerName

Specifies an array of Hyper-V hosts. The cmdlet modifies isolation settings for virtual machines hosted by the computers that you specify.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Credential

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

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

-DefaultIsolationID

Specifies the ID of the network for traffic to the default compartment on virtual machines that have multitenancy enabled. The value that you specify applies only to untagged traffic. This parameter has an effect only if you specify a value of $True for the AllowUntaggedTraffic parameter.

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

-IsolationMode

Specifies the isolation mode for the adapter. The acceptable values for this parameter are:

  • NativeVirtualSubnet. Hyper-V Network Virtualization.
  • ExternalVirtualSubnet. A third party network virtualization solution.
  • VLAN.
  • None.

If you specify a value of None, the network adapter uses its default isolation mode. Set the default isolation mode by using the Set-VMNetworkAdapterVlan cmdlet or the Set-VMNetworkAdapter cmdlet.

Type:VMNetworkAdapterIsolationMode
Accepted values:None, NativeVirtualSubnet, ExternalVirtualSubnet, Vlan
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ManagementOS

Indicates that the cmdlet operates on the parent or host operating system. If you specify this parameter, this cmdlet modifies isolation settings for the parent or host operating system.

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

-MultiTenantStack

Specifies whether to use multiple isolation IDs for the virtual machine. The acceptable values for this parameter are:

  • On. Indicate isolation IDs so that the virtual machine provides services to multiple tenants on different isolation subnets.
  • Off. Do not indicate isolation IDs to virtual machine.
Type:OnOffState
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Passthru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

-VM

Specifies an array of virtual machine objects. The cmdlet modifies isolation settings for adapters that belong to the virtual machines that you specify. To obtain a virtual machine object, use the Get-VM cmdlet.

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

-VMName

Specifies an array of names of virtual machines. The cmdlet modifies isolation settings for adapters that belong to the virtual machines that you specify.

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

-VMNetworkAdapter

Specifies an array VM network adapters as VMNetworkAdapterBase objects. The cmdlet modifies isolation settings for the adapters that you specify. To obtain a network adapter, use the Get-VMNetworkAdapter cmdlet.

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

-VMNetworkAdapterName

Specifies the name of a virtual network adapter. The cmdlet modifies isolation settings for the adapters that you specify.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

None

Outputs

Microsoft.HyperV.PowerShell.VMNetworkAdapterIsolationSetting