another question with suggested code,
- // ------- UpdateVirtualSwitch -------
- var spec = new VcHostVirtualSwitchSpec();
- spec.numPorts = 128;
- spec.bridge = new VcHostVirtualSwitchBondBridge();
- //spec.bridge.nicDevice = System.getModule("com.vmware.onyx").array(String, 1);
- //spec.bridge.nicDevice[0] = "vmnic1";
- var nicArray = new Array();
- var nic = new String("vmnic1");
- nicArray.push(nic);
- spec.bridge.nicDevice = nicArray;
- System.debug("spec: " + spec);
- System.debug("nicdevice: " + spec.bridge.nicDevice);
- var confMgr = currentHost.configManager;
- var theHostsHostNetworkSystem = confMgr.networkSystem;
- theHostsHostNetworkSystem.updateVirtualSwitch("vSwitch1", spec); // HostNetworkSystem
i try with this and can add vmnic, also replaces the existent one vmnic, it works great, but it's possible remove vmnic? (leave vswitch without uplinks for example)
Thanks
Best regards