VMware Cloud Community
mastefani
Enthusiast
Enthusiast
Jump to solution

Network Profile - selected network (networkSelectionIds)

We're making use of the Network Configure event topic to pull an IP from our IPAM solution, but I have a question on how the Network Profile determines which network to use.  We use tags when we want to provision into a specific network segment, but for general use Test we have 3-4 subnets we'd like to use and we don't care which one.  If all of these networks are tagged the same it seems like vRA just randomly picks one.  Is there any way to influence this decision or an event topic that fires off before this where we can?  

 

The concern we have is when one fills up it will continue to be randomly selected (since vRA doesn't know it's full).  Since no IPs are available provisioning will fail.  I'd prefer to build some logic into this where vRO queries IPAM and determines which of the network has the most free IPs and use this one. 

0 Kudos
1 Solution

Accepted Solutions
mastefani
Enthusiast
Enthusiast
Jump to solution

So I figured this one out over the last few days.  Basically in the Network Configure event vRA is passing all the networkSelectionIds that match your criteria or tag in a 3D array.  In our vRO WF I'm iterating through each one of these and getting the CIDR via REST call to vRA (<vraserver>/iaas/api/fabric-networks/<netselectid>).  Once I have the CIDR I'm querying our IPAM to get the number of free IPs available.  After we decide which one we want to use we then push networkSelectionIds back as an output of type (3D array), but this time with only the one networkSelectionId we want.  In our testing this seems to work just fine and essentially force vRA to use a specific network from a list of possible ones.

View solution in original post

0 Kudos
4 Replies
eswoodford
Contributor
Contributor
Jump to solution

Not sure if I can answer directly as you said you're using an event topic to pull the IP, but we're doing something 'similar'. 

I have configured an Infoblox integration to provide my IPAM support. Each network has its IP address range mapped to an Infoblox segment. The cloud template says to pull the next-available-host IP address and apply it. I believe because of the IP address mapping, VRA is able to 'see' that the network is full, and try to select a new one because it's aware of the IPAM range. 

I get issues when someone deploys a machine outside VRA and Infoblox isn't updated. The deployment will proceed all the way to the allocating network phase and fail because of conflicts. I'm only able to deploy to this network after I reserve that address directly in Infoblox.

0 Kudos
skarkhanis
Contributor
Contributor
Jump to solution

We were in the exact same situation so we tried to put 3 subnets out which 2 were full and hoping VRA will choose the 1 which was not full!

Sadly, VRA randomly selects the network out of 3 and it did choose 1 which was full and provisioning failed at Infoblox IPAM

So in short, it's just Random!

We are now trying to manipulate this decision on Network Configure subscription where we can edit networkSelectionIds and put only those which are not full out of 3 or x whatever are present in network profile!

0 Kudos
mastefani
Enthusiast
Enthusiast
Jump to solution

So I figured this one out over the last few days.  Basically in the Network Configure event vRA is passing all the networkSelectionIds that match your criteria or tag in a 3D array.  In our vRO WF I'm iterating through each one of these and getting the CIDR via REST call to vRA (<vraserver>/iaas/api/fabric-networks/<netselectid>).  Once I have the CIDR I'm querying our IPAM to get the number of free IPs available.  After we decide which one we want to use we then push networkSelectionIds back as an output of type (3D array), but this time with only the one networkSelectionId we want.  In our testing this seems to work just fine and essentially force vRA to use a specific network from a list of possible ones.

0 Kudos
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
0 Kudos