VMware Cloud Community
tgrayatshi
Contributor
Contributor

Set-NetworkAdapter error Portgroup not accessible from this host

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

Set-NetworkAdapter.png

Has anyone seen this error before?

I have used this thread for reference:  Set-NetworkAdapter to standard switch from DVS

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

Since a VSS is defined on the ESXi node level, could it be that the node where the VM is currently running, doesn't have that VSS + portgroup defined?
Did you check what is in $ostdportgrouptouse?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tgrayatshi
Contributor
Contributor

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?

Reply
0 Kudos
LucD
Leadership
Leadership

No, you can't even, there is no parameter to specify a VSS on the Set-NetworkAdapter cmdlet.

Did you already try doing a vMotion of that VM to another ESXi node.
And then try your script again?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos