Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: Add physical to standard vswitch with orchestrator

$
0
0

another question with suggested code,

  1. // ------- UpdateVirtualSwitch -------  
  2.   
  3. var spec = new VcHostVirtualSwitchSpec();  
  4.   
  5. spec.numPorts = 128;  
  6.   
  7. spec.bridge = new VcHostVirtualSwitchBondBridge();  
  8. //spec.bridge.nicDevice = System.getModule("com.vmware.onyx").array(String, 1);  
  9. //spec.bridge.nicDevice[0] = "vmnic1";  
  10.   
  11. var nicArray = new Array();  
  12. var nic = new String("vmnic1");  
  13. nicArray.push(nic);  
  14. spec.bridge.nicDevice = nicArray;  
  15.   
  16. System.debug("spec: " + spec);  
  17. System.debug("nicdevice: " + spec.bridge.nicDevice);  
  18.   
  19. var confMgr = currentHost.configManager;  
  20. var theHostsHostNetworkSystem = confMgr.networkSystem;  
  21. 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


Viewing all articles
Browse latest Browse all 219257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>