I am trying to create a catalog to provision the VM. I have created a service plan with customisation enabled for memory and CPU and added that to inputs. The generated configuration in the catalog expects the plan as follows
I am inserting my customOptions here to replace the maxcores and maxMemory.
Here The value for memory is expected to be provided in bytes whereas I want the user to enter in GB
Is there any way to insert arithmetic operations in order to convert GB to bytes.
Also, life get’s easier if you update to the 6.1.X branch where we introduced form builder. There is a native disk and plan form field. Additionally, we have a Byte Size field that will do the arithmetic for you.
It’s important to note, if you need a value to be passed as an integer like the above example of @vsenthilkarasu you should add a toLong() on it so it’s evaluated properly like:
You must wrap that entire string in quotes. The toLong() is going to convert the string to an integer on submission.
The JSON validation errors on non-string Morpheus variables until at least 6.2.1, where we removed the validation of JSON to allow more free form entry and creative ideas.
Hi @cbunge , I put it in both single and double quotes but it still gets the same result. My version is 6.1.2 Did I do it correctly, didn’t? Sorry if I don’t understand what you mentioned
Yes I’m still getting the 500 error. I’m creating a catalog to create 2 VMs that refer to an existing blueprint, and the only input field I want to change is ‘maxMemory’ inside ‘ServicePlanOptions’. I try some of the formats but it’s returned 500. The only format that can be done is <%=customOptions.memGB%> without quotes or toLong().*1024*1024*1024 like this: