VMware Cloud Community
marafante
Contributor
Contributor
Jump to solution

Customizing IP address during deployment - vRA NETWORK CONFIGURE & vRO

Hello,

 

I'm trying to code a simple vro workflow subscribed to Network Configure event topic that assigns a custom IP to a deployment, but the deloyment ever fails with "Extensibility triggered task failed. Event ID: 5bf15980-e46b-39c8-9cce-2cc1b03974a5. Failure: : Expected BEGIN_ARRAY but was STRING at line 1 column 16 path $.addresses[0]".

Workflow was configured to have an output named addresses as an array of string and the variable was binded to the scriptable task too.

The scriptable task code is:

 

addresses = new Array();
addresses = [["192.168.0.10"]];
 
Does anyone accomplished this task and has some example code to share?
 
Regards
Reply
0 Kudos
1 Solution

Accepted Solutions
emacintosh
Hot Shot
Hot Shot
Jump to solution

I believe you want the output to just be of type Array (not of type String, with Array checked).  And the expected output is a two-dimensional array - the first dimension identifying the machine in the deployment, and the second defining the ip's for that machine.  So in your case, maybe something like

addresses = [[]];
addresses[0] = ["192.168.0.10"];

 

View solution in original post

3 Replies
emacintosh
Hot Shot
Hot Shot
Jump to solution

I believe you want the output to just be of type Array (not of type String, with Array checked).  And the expected output is a two-dimensional array - the first dimension identifying the machine in the deployment, and the second defining the ip's for that machine.  So in your case, maybe something like

addresses = [[]];
addresses[0] = ["192.168.0.10"];

 

marafante
Contributor
Contributor
Jump to solution

Great emacintosh!

It works now. Thanks a lot!

Tags (1)
carl1
Expert
Expert
Jump to solution

Just for completeness and since this is resolved my problem as well.  You should not only return "addresses" but also "networkSelectionIds" to tell vRA what cable you chose.

Background:  vRA gives you a list of networkSelectionIds, which tells you all the vCables that the VM could be connected to.  So, the normal pattern would be to ask your IPAM system for an address on the first cable.  If it is full, then ask it for an IP from the 2nd cable, etc.  You need to tell vRA what cable your IP is for so that the VM is configured correctly.

 

Carl L.