Add-VDSwitchPhysicalNetworkAdapter Command | Vmware PowerCLI Reference

Add-VDSwitchPhysicalNetworkAdapter

This cmdlet adds host physical network adapters to a vSphere distributed switch.

Syntax

Add-VDSwitchPhysicalNetworkAdapter
[ -DistributedSwitch ] < DistributedSwitch >
-VMHostPhysicalNic < PhysicalNic[] >
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[-VMHostVirtualNic < HostVirtualNic[] > ]
[-VirtualNicPortgroup < VDPortgroup[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
DistributedSwitch DistributedSwitch 1
  • pipeline
Specifies the vSphere distributed switch to which you want to add the host physical network adapter.
required
VMHostPhysicalNic PhysicalNic[] named
  • wildcards
Specifies the host physical network adapters that you want to add or migrate to the vSphere distributed switch.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
optional VMHostVirtualNic HostVirtualNic[] named
Specifies the host virtual network adapters to be migrated along with the physical adapter, so that their connectivity is preserved.
optional VirtualNicPortgroup VDPortgroup[] named
Specifies the port groups to which to attach the host virtual network adapters. Accepts either one port group, or the same number of port groups as the number of virtual network adapters specified. If one port group is specified, all adapters are attached to that port group. If the same number of port groups as the number of virtual network adapters are specified, the first adapter is attached to the first port group, the second adapter - to the second port group, and so on.

Output

Examples

Example 1

$vmhostNetworkAdapter = Get-VMHost "MyVMHost" | Get-VMHostNetworkAdapter -Physical -Name vmnic2
Get-VDSwitch "MyVDSwitch" | Add-VDSwitchPhysicalNetworkAdapter -VMHostPhysicalNic $vmhostNetworkAdapter

Retrieves the specified physical network adapter from the specified host and adds it to the specified vSphere distributed switch.

Example 2

$myVMHost = Get-VMHost "MyVMHost"
$physicalNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -Name "vmnic0"
$virtualNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -Name "vmk0"
Get-VDSwitch -Name "MyVDSwitch" | Add-VDSwitchPhysicalNetworkAdapter -VMHostPhysicalNic $physicalNic -VMHostVirtualNic $virtualNic -VirtualNicPortgroup 'MyVDPortGroup'

Migrates a host physical network adapter and a virtual network adapter to a vSphere distributed switch.

Related Commands

VDSwitch

This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file.

This cmdlet retrieves vSphere distributed switches.

This cmdlet creates vSphere distributed switches.

This cmdlet removes vSphere distributed switches.

This cmdlet modifies the configuration of vSphere distributed switches.

VDSwitchPhysicalNetworkAdapter

This cmdlet adds host physical network adapters to a vSphere distributed switch.

This cmdlet removes host physical network adapters from the vSphere distributed switches they are connected to.

VDSwitchPrivateVlan

This cmdlet retrieves the private VLAN configuration entries of a vSphere distributed switch.

This cmdlet creates private VLAN configuration entries on a vSphere distributed switch.

This cmdlet removes private VLAN configuration entries from vSphere distributed switches.

VDSwitchVMHost

This cmdlet adds hosts to the specified vSphere distributed switch.

This cmdlet removes hosts from the specified vSphere distributed switches.