All,
I am working on a migration script where we have to remove from an existing 1000v and then move onto another. My remove part works great, but when trying to add the adapter to the other side I am having problems because it does not add to the right uplink group. Is there a way to tell the physical interface vmnic1 to be part of an uplink port group.
My original script (just the vmnic1 part)
#remove 1 interface from standard to be added to DVS
#Add to new DVSwitch and swing leg overGet-VirtualSwitch-VMHost$VMHost-name"vSwitch0" | Set-VirtualSwitch-Nic"vmnic0"-Confirm:$false$VDSwitch=Get-VDSwitch | Where {$_.Name -eq"VSM01"}$VDSwitch | Add-VDSwitchVMHost-VMHost$VMHost-Confirm:$false$vmhostadapter=$VMhostObj | Get-VMHostNetworkAdapter-Physical-Namevmnic1$VDSwitch | Add-VDSwitchPhysicalNetworkAdapter-VMHostNetworkAdapter$vmhostadapter-Confirm:$false
How can i tell vmnic1 to use uplink port group 10G-Phys?
I tried this but got error below:
$uplinkportgroup=Get-VDPortgroup-name phys-10g -VDSwitch$VDSwitchSet-VMHostNetworkAdapter -PortGroup $uplinkportgroup-PhysicalNic$vmhostadapter
PowerCLI U:\> Set-VMHostNetworkAdapter -PortGroup $uplinkportgroup -Physicalnic $vmhostadapter Set-VMHostNetworkAdapter : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1 + Set-VMHostNetworkAdapter -PortGroup $uplinkportgroup -Physicalnic $vmhostadapter + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-VMHostNetworkAdapter], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVMHostNetwork Adapter