Yes - dvSwitches in play here. Probably an important piece of info we should have shared.
Arnim v Lieshout wrote:
I now understand what you want to achieve, although using portgroups has more benefits then the VLAN ID only.
Can you elaborate? We want to be sure we not missing something, but as far as I can tell, for our network model, this should work well. I suppose we lose the ability to set traffic shaping, security, and fail-over policies on a per-VLAN basis, but I don't think we necessarily need that.
One last powerCLI related question. That code assumes you have a dvPort number - is it possible to get that port number from an existing network adapter? Ie. something in the Get-NetworkAdpater namespace? In order to set the VLAN appropriately, we need to know which port the VM's connected to.