VMware Cloud Community
Windspirit
Hot Shot
Hot Shot

vRA 7.4 Custom Forms and external values

Hi,

I want to do the following:

Use the CPU field in a Custom Form and then give it a maximum that depends on a vRO value.

Capture.PNG

So I use an action in vRO that returns type Number and just does return 4; nothing fancy just testing at this stage....but the error throws me.

My Blueprint has for CPU values between 1 and 16 so I get where it comes from but that smells like a bug to me.

Anyone any Idea?

Tags (3)
2 Replies
Windspirit
Hot Shot
Hot Shot

So...I made some progress  in digging into this issue:

  • Check out my other post: Re: vRA 7.4 Custom Forms and Custom Properties
  • The Constrains work for the normal integer field just fine. Just not for Memory and CPU (BUG!)
  • Creating integer custom property only lets you choose Sting values on the canvas
  • Using Custom Properies such as VirtualMachine.Memory.Size or VirtualMachine.CPU.Count in the Custom Forms result in allocation error.

What works..but its bloody stupid is the following:

  • Create two integer fields in the Custom Form, put external restrictions on it as required.
  • create an workflow where you link the integer fields to the custom properties VirtualMachine.Memory.Size and VirtualMachine.CPU. (See attached...you can get LogAllProps here: logAllProps​). Please not that you integer field will have a different FieldID.
  • Create an Subscription to PRE VMPSMasterWorkflow32.BuildingMachine (block) and the workflow
  • Add the custom Property Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine with value * to your VM blueprint

The two MAJOR problem with that method.

1) it goes behind vRAs Resource Management system. vRA will thing that you are provisioning a VM with 1CPU and 1GB...but then you change it before its build...so you have to be careful with that.

2) the Values of the VCACVM entity isn't updated....so you need to add a function to update them as well.

Reply
0 Kudos
Ivan_Ivanov1
Contributor
Contributor

Hi Daniel,

You can workaround this by using External Validations tab.

  1. Create vRO action which accepts a number parameter and returns a string
  2. Open the Designer and click on the External Validations tab
  3. Add new custom validation and search for your action
  4. For the input parameter select the CPU
  5. If you want the validation to be triggered, in the vRO action return a string with the error message. If you return null or empty sting the value will be considered as valid.

The custom validation will be triggered when the submit button is clicked, and all other validations are executed before that.

For more details you can look at my blogpost for using the Custom Forms at: Customizing request forms using the new Custom Forms - VMware Cloud Management

You can find more details for the Custom Validations at the end of the blogpost.