VMware Cloud Community
msk05
Hot Shot
Hot Shot

Custom request form

We are trying to create dynamic custom properties in the bleuprint while users are requesting a machine.

Example we have a custom property definition as below

vmstorage.type - small, medium, large

When user select "small" storage type, it dynamically select 50 GB memory internally and the machine provision with 50 GB as base disk or additional hard disk. How do we logically write a script for this to happen in vRO?

Reply
0 Kudos
4 Replies
iiliev
VMware Employee
VMware Employee

In vRO, if you want some input fields to dynamically change their values based on the values of some other input field(s), you would use Data binding presentation property.

So usually you write a small vRO scripting action that takes as an input parameter the value of the source field, and computes/returns the value for the target field. Then, in vRO workflow designer's Presentation tab, you add Data binding property to the target input field, and sets its value to be a call to your action; it should look something like the following (in the sample code, the action name is computeDiskSize, and the input field it depends on is field1)

  GetAction("com.mycompany.myproduct","computeDiskSize").call( #field1 )

The scripting code of the action should implement your business logic, could be something like:

if (arg0 == "small") return "50";

else if (arg0 == "medium") return "100";

else if (arg0 == "large") return "200";

else return "-1";

Reply
0 Kudos
msk05
Hot Shot
Hot Shot

Hello Ilian, Thanks for your response. Does this really change the hard disk size of the VM and inside the guest OS? Or is it just the tagging metadata information of the VM changing through this script?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

No, this doesn't really change disk sizes of the VM. It only shows one possible generic way to implement dynamic computation of presentation fields' values in a vRO workflow. It is probably not directly applicable to your case where you have a concrete blueprint.

Reply
0 Kudos
msk05
Hot Shot
Hot Shot

Got it. We have already tested dynamic dropdown attributes through vRO. Is there a possible way to achieve changing the disk size while requesting a VM from vRA? If it is could you please suggested a logic in vRO to achieve it.

Reply
0 Kudos