Are you trying to change the network link for an existing virtual nic?
If you are trying to do the above, thenbelow steps might be helpful for you:
1. Create a virtualdeviceconfigspec data object and assign the device property of this object to the virtual device of which you are trying to change the virtual nic. You can retreive the required network device from the vm.config.hardware.device property which consists an array of virtual devices.
2. In VirtualDeviceConfigSpecOperation, you need to use edit operation as you are trying to change the network.
3. Set the the device.backing property of the VirtualDeviceConfigSpec to the type of backing you want to use, like , VirtualEthernetCardNetworkBackingInfo nic = new VirtualEthernetCardNetworkBackingInfo()
and set the deviceName property of this nic to the name of the network to which you want to connect your device to.
4. Pass this virtualdeviceconfigspec in the deviceChange property of virtualmachineconfigspec.