Automation

 View Only
  • 1.  Set-NetworkAdapter error Portgroup not accessible from this host

    Posted Sep 05, 2019 06:23 PM

    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



  • 2.  RE: Set-NetworkAdapter error Portgroup not accessible from this host

    Posted Sep 05, 2019 06:30 PM

    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?



  • 3.  RE: Set-NetworkAdapter error Portgroup not accessible from this host

    Posted Sep 05, 2019 06:36 PM

    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?



  • 4.  RE: Set-NetworkAdapter error Portgroup not accessible from this host

    Posted Sep 05, 2019 06:55 PM

    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?