We need to move a VM from a PortGroup on a vDS to a PortGroup on a vSS. It is an appliance, so we can't choose a vSS, in the GUI.
When we run this script, we get the error below.
$VM0 = Get-VM -Name vmname
$ostdportgrouptouse = Get-VirtualPortGroup -VMHost $VM0.vmhost -Standard -name "vmotion-01"
Get-NetworkAdapter -VM $VM0 -Name "Network adapter 2" |
Set-NetworkAdapter -Portgroup $ostdportgrouptouse
Get-NetworkAdapter -VM $VM0
Has anyone seen this error before?
I have used this thread for reference: Set-NetworkAdapter to standard switch from DVS
The $ostdportgrouptouse variable contains the portgroup we are looking for. The VM is sitting on that host and all of the hosts in that cluster and even the vCenter have the same port groups for the vMotion vmkernals.
The portgroup we want is in vSwitch2, Do we need to specify that?