Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Look up portgroup (VC:DistributedVirtualPortgroup)

$
0
0

I have a workflow where I am trying to change the port group of a VM based on the IP address specified.

 

So after some searching around I came across the Connect virtual machine NIC number to distributed virtual port group package. The problem I need help with is how do I programmatically specify the port group I want the the script to change the VM to.

 

In my workflow I have a scriptable task (see the JS code below) before the Connect virtual machine NIC number to distributed virtual port element that takes the IP as the input and I want it to output the port group needed for the Connect virtual machine NIC... element to execute, object type (VC:DistributedVirtualPortgroup). I manually entered all the possible port groups in a switch statement but its not working. Any idea how to return the right object based on the dvGroup name or ID specified in the switch statement? Is that even the right way of doing this?

 

var _ip = IP;

switch ((_ip.substring(0, _ip.lastIndexOf('.')))) {
  case "10.10.80":    dvGroup = "Management (Dev38-80) (dvSwitch-Converged10G)";    break;
//and so forth
}

 

 

Also, is there anyway to pause execution  of the javascript code and interactively troubleshoot (like the dev console in chrome?)

 

Thanks.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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