VMware Cloud Community
skarkhanis
Contributor
Contributor
Jump to solution

How to change networkSelectionIds on Network Configure Event in VRO 8.5

Hi All,

We have multiple 

I am trying to provide a specific network in Network Profile on the event of Network Configure so that we can provide the network which has least utilization.

As per the documentation, networkSelectionIds is a 3-dimensional array. I am confused on how to properly set the networkSelectionIds.

Below is the output of inputProperties which I get and from which I want to select only 1

"networkSelectionIds":[
[
[
"0123",
"43214"
],
[
"0123",
"43214"
]
]
]

I only want to keep let's say for example 43213 and force VRA to choose IP from 43213 network

Can anyone please help out!!!

 

 

0 Kudos
1 Solution

Accepted Solutions
skarkhanis
Contributor
Contributor
Jump to solution

@mastefani  Yes we are working towards the same solution, we are only facing in creating the 3D array, somehow we are not able to create the correct format, if you could please psate the code of adding the networkSelectionIds into array it would be huge help!!

We are trying following code:

var myArr = new Array();

myArr[0] = new Array();

myArr[0][0] = new Array()

myArr[0][1] = new Array();

myArr[0][0][0] = "4321";

myArr[0][1][0] = "4321";

 

And are always getting following error in MAchine Allocation stage;

java.lang.illegalStateExceptionL Expected BEGIN_ARRAY but was STRING at line 1

SOLUTION:

So the solution is to keep output parameter as type of "Array/Array" which is Array of Array and apply the above code!

View solution in original post

0 Kudos
2 Replies
mastefani
Enthusiast
Enthusiast
Jump to solution

Skarkhanis, I just updated my post:  https://communities.vmware.com/t5/vRealize-Automation-Tools/Network-Profile-selected-network-network...  and I think it explains how to do what you're looking to do.  Check it out and let me know if that works for you guys.

skarkhanis
Contributor
Contributor
Jump to solution

@mastefani  Yes we are working towards the same solution, we are only facing in creating the 3D array, somehow we are not able to create the correct format, if you could please psate the code of adding the networkSelectionIds into array it would be huge help!!

We are trying following code:

var myArr = new Array();

myArr[0] = new Array();

myArr[0][0] = new Array()

myArr[0][1] = new Array();

myArr[0][0][0] = "4321";

myArr[0][1][0] = "4321";

 

And are always getting following error in MAchine Allocation stage;

java.lang.illegalStateExceptionL Expected BEGIN_ARRAY but was STRING at line 1

SOLUTION:

So the solution is to keep output parameter as type of "Array/Array" which is Array of Array and apply the above code!

0 Kudos