VMware Cloud Community
_MikeW_
Enthusiast
Enthusiast
Jump to solution

vRA 8.1, Programmatically set inputProperties.customProperties?

I am attempting to find a method of setting inputProperties.customProperties.* variables within a workflow run to provision a host.

If there is a better convention feel free to suggest it.

Basically I have a need to access those variables from various points during the provisioning process AND during day 2 actions. I want to be able to retrieve and update those variables.

Using something like

inputProperties.customProperties.put("cidrs", [[String(context.ipv4cidr), String(context.ipv6Cidr)]]);

Doesn't cause an error and the log in that workflow shows it as inserted but when attempting to get the same custom property from another workflow it doesn't exist.

When the VM is built I check the Service Broker->Deployments->Host->machine->Custom Properties I don't see them there either.

Any suggestion on a direction I can go to solve this problem?

Reply
0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

You need to set customProperties as an output variable, see vRA 8 – My First Extensibility Workflow – vRO Edition – vBombarded and put your values into that, not to the input variable.

From a vRA ABX action, you need to return an object with a property called customProperties:

outputs.customProperties = {'myprop': 'myValue'};

return outputs;

View solution in original post

Reply
0 Kudos
3 Replies
xian_
Expert
Expert
Jump to solution

You need to set customProperties as an output variable, see vRA 8 – My First Extensibility Workflow – vRO Edition – vBombarded and put your values into that, not to the input variable.

From a vRA ABX action, you need to return an object with a property called customProperties:

outputs.customProperties = {'myprop': 'myValue'};

return outputs;

Reply
0 Kudos
_MikeW_
Enthusiast
Enthusiast
Jump to solution

So I need to setup an output for customProperties (Array?)

and then

customProperties.cidrs = new Array(String(context.ipv4cidr), String(context.ipv6Cidr));

I thought I had tried that (this is a workflow, not a action) but no joy. I'll give it another spin and see what happens and update the thread.

Reply
0 Kudos
_MikeW_
Enthusiast
Enthusiast
Jump to solution

Previously when I tested I tried to set customProperties to "array" and not "Properties" type. Once set to Properties it worked.

Thanks!

Reply
0 Kudos