You can migrate
both physical and virtual network adapters to a vSphere distributed switch
simultaneously.
Prerequisites
Verify that you are connected
to a
vCenter
Server
system.
Procedure
-
Get the physical network
adapters that you want to migrate.
$pNics = Get-VMHostNetworkAdapter -VMHost $vmhost -Physical
-
Get the virtual network
adapters that you want to migrate.
$vNicManagement = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk0
$vNicvMotion = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk1
-
Get the port groups
corresponding to the virtual network adapters that you want to migrate to the
vSphere distributed switch.
$vdPortgroupManagement = Get-VDPortgroup -VDSwitch $vds -Name 'Management Network'
$vdPortgroupvMotion = Get-VDPortgroup -VDSwitch $vds -Name 'vMotion Network'
-
Migrate all network
adapters to the vSphere distributed switch.
Add-VDSwitchPhysicalNetworkAdapter -DistributedSwitch $vds -VMHostPhysicalNic $pNics -VMHostVirtualNic $vNicManagement,$vNicvMotion -VirtualNicPortGroup $vdPortGroupManagement, $vdPortGroupvMotion
Results
You migrated the
$vNicManagement network
adapter to the Management Network port group and the
$vNicvMotion network
adapter to the vMotion Network port group.