I threw in the disconnect and connect later, hoping it might change things for the better. I also threw the mac_address in to preserve mac. (works/doesn't work either way)
Essentially, using the patch, I'm able to switch network on a live VM. However, when I reboot that VM, nothing works. The definition in the config of the VM looks sane (shows the changed network), but it doesn't come onto the network.
If, via vcenter webui, I disconnect the vnic and reconnect, on reconnect, I get the error :
"Invalid configuration for device '0'"
And when I look a the host esxi logs for hostd, I see:
"Device spec doesn't match up with dvport/dvpg configuration"
So, let's say the vm network name is "Dev", and when I look at the VM, it says the vmnic is on "Dev". I can get this working for the rebooted VM by using the webui and selecting "Dev" as a config change through the drop down, even though "Dev" is already selected. Then it works. I've taken config dump of the VM both using my automated api process and doing things through the webui and they don't look different. And again, the network switch works on a live VM, it just messes up on reboot. Is there a "way" to do what I'm trying to do through the api, that is, switch networks, that works live and works on reboot of the VM as well?