New-SCLogicalSwitchVirtualNetworkAdapter
Adds a virtual network adapter (VNIC) to a logical switch.
Syntax
New-SCLogicalSwitchVirtualNetworkAdapter
-UplinkPortProfileSet <UplinkPortProfileSet>
[-EthernetAddressType <EthernetAddressType>]
[-IPv4AddressType <EthernetAddressType>]
[-IPv6AddressType <EthernetAddressType>]
[-VMNetwork <VMNetwork>]
[-VMSubnet <VMSubnet>]
[-PortClassification <PortClassification>]
[-VLanEnabled <Boolean>]
[-VLanID <UInt16>]
[-IPv4AddressPool <StaticIPAddressPool>]
[-IPv6AddressPool <StaticIPAddressPool>]
[-InheritsAddressFromPhysicalNetworkAdapter <Boolean>]
[-IsUsedForHostManagement <Boolean>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[[-Description] <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
The New-SCLogicalSwitchVirtualNetworkAdapter cmdlet adds a virtual network adapter (VNIC) for the host to the Uplink Port Profile as part of the logical switch definition.
Examples
Example 1: Creates a new logical switch virtual network adapter
PS C:\> $UPPSet = Get-SCUplinkPortProfileSet -Name "R1Uplink"
PS C:\> $VmNetwork = Get-SCVMNetwork -Name "MgmtNet"
PS C:\> New-SCLogicalSwitchVirtualNetworkAdapter -Name "LogSw01_Storage" -UplinkPortProfileSet $uppSetVar -RunAsynchronously -VMNetwork $vmNetwork -VLanEnabled $true -VLanID 2162 -IsUsedForHostManagement $false -IPv4AddressType "Dynamic" -IPv6AddressType "Dynamic"
The first command gets an uplink port profile set by using the Get-SCUplinkPortProfileSet cmdlet, and then stores it in the $UPPSet variable.
The second command gets the virtual machine network named MgmtNet by using the Get-SCVMNetwork cmdlet, and then stores it in the $VmNetwork variable.
The final command creates a logical switch virtual network adapter that gets deployed to the host along with the logical switch.
Parameters
-Description
Specifies a description for the virtual network adapter.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EthernetAddressType
Specifies an Ethernet address type. The acceptable values for this parameter are:
- Dynamic
- Static
Type: | EthernetAddressType |
Accepted values: | Dynamic, Static |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InheritsAddressFromPhysicalNetworkAdapter
Indicates whether the network adapter inherits its address from a physical network adapter.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4AddressPool
Specifies a static address pool that contains IPv4 addresses.
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4AddressType
Specifies an IPv4 address type. The acceptable values for this parameter are:
- Dynamic
- Static
Type: | EthernetAddressType |
Accepted values: | Dynamic, Static |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6AddressPool
Specifies a static address pool that contains IPv6 addresses.
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6AddressType
Specifies an IPv6 address type. The acceptable values for this parameter are:
- Dynamic
- Static
Type: | EthernetAddressType |
Accepted values: | Dynamic, Static |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsUsedForHostManagement
Indicates whether the virtual network adapter is used for host management.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of the network adapter.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PortClassification
Specifies the port classification of the switch to which the virtual network adapter connects.
Type: | PortClassification |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UplinkPortProfileSet
Specifies an uplink port profile set object.
To obtain an uplink port profile set object, use the Get-SCUplinkPortProfileSet cmdlet.
Type: | UplinkPortProfileSet |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VLanEnabled
Indicates whether to enable a virtual LAN (VLAN) for use by virtual machines on a Hyper-V or Citrix XenServer host.
- Example format for a single VLAN:
-VLANEnabled -VLANMode "Access" -VLANID 35
- Example format for multiple VLANs:
-VLANEnabled -VLANMode "Trunk" -VLANTrunkID 1,2,100,200,1124
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VLanID
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 -VLanMode "Access" -VLANID 35
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
Specifies a VMM server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetwork
Specifies a VM network object.
To get a VM network object, use the Get-SCVMNetwork cmdlet.
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMSubnet
Specifies a virtual machine subnet object.
To obtain a VMSubnet object, use the Get-SCVMSubnet cmdlet.
Type: | VMSubnet |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |