Blog

A property toolkit example

{% raw %}

Here we have a property definition called My.RequestForm.Prop, and the possible values for it are A, B and C.  We want to set a group of 5 other properties based on that selection as follows:

If My.RequestForm.Prop == A
      Test.Prop.Foo1 == “A”
      Test.Prop.Foo2 == “blah”
      Test.Prop.Foo3 == “0”
      Test.Prop.Foo4 == “trees”
      Test.Prop.Foo5 == “prod”

if My.RequestForm.Prop == B
      Test.Prop.Foo1 == “Z”
      Test.Prop.Foo2 == “blahblah”
      Test.Prop.Foo3 == “1”
      Test.Prop.Foo4 == “flowers”
      Test.Prop.Foo5 == “dev”

if My.RequestForm.Prop == C
      Test.Prop.Foo1 == “Q”
      Test.Prop.Foo2 == “blahblahblah”
      Test.Prop.Foo3 == “2”
      Test.Prop.Foo4 == “bees”
      Test.Prop.Foo5 == “qa”

 

And if the value is none of these, set the values of Test.Prop.Foo1 -5 to “UNKNOWN”

Here is the JSON template for this scenario:

This uses an array of name/value pairs.  The name is the name of the VM property you want to set, and the value is a valid SovLabs Template Engine template.  (See the SovLabs Template Engine article for more)

In the example below, the Template Engine statement is a case statement which evaluates the value of My.RequestForm.Prop and outputs the desired string based on that value.

The SovLabs Template Engine statement is in double quotes.

 

[
   {
     “name”: “Test.Prop.Foo1”,
     “value”: “{% case My.RequestForm.Prop %}{% when ‘A’ %}A{% when ‘B’ %}Z{% when ‘C’ %}Q{% else %}UNKNOWN{% endcase %}”
   },
   {
     “name”: “Test.Prop.Foo2”,
     “value”: “{% case My.RequestForm.Prop %}{% when ‘A’ %}blah{% when ‘B’ %}blahblah{% when ‘C’ %}blahblahblah{% else %}UNKNOWN{% endcase %}”
   },
   {
     “name”: “Test.Prop.Foo3”,
     “value”: “{% case My.RequestForm.Prop %}{% when ‘A’ %}0{% when ‘B’ %}1{% when ‘C’ %}2{% else %}UNKNOWN{% endcase %}”
   },
   {
     “name”: “Test.Prop.Foo4”, “value”: “{% case My.RequestForm.Prop %}{% when ‘A’ %}trees{% when ‘B’ %}flowers{% when ‘C’ %}bees{% else %}UNKNOWN{% endcase %}”
   },
   {
     “name”: “Test.Prop.Foo5”,
     “value”: “{% case My.RequestForm.Prop %}{% when ‘A’ %}prod{% when ‘B’ %}dev{% when ‘C’ %}qa{% else %}UNKNOWN{% endcase %}”
   }
 ]

 

In your vRA blueprint, you would create a Custom Property called SovLabs_createProperties_<some_name>  

In the value field, you would paste in the JSON above.   When provisioning happens, the Property Toolkit will process the template and set the VM properties with the derived values.  Alternatively, you could create a Property group containing multiple SovLabs_createProperties_<name> property definitions, as long as the names are unique.

 

{% endraw %}

The Cloud ROI Newsletter

Exclusive insights and strategies for cloud and FinOps pros. Delivered straight to your inbox.

Related Blogs

 
thumbnail
What We Learned at FinOps X 2025: From Dashboards to Decisions

At FinOps X 2025, one message echoed across sessions and conversations: FinOps is growing up. The scope is expanding. The…

 
thumbnail
Why Most FinOps Teams Are Still Stuck—And How to Break the Loop

The 2025 CloudBolt Industry Insights (CII) report revealed that 58% of organizations take weeks or longer to remediate cloud-cost waste—even…

 
thumbnail
Cloud ROI Is Still Out of Reach: What 350 IT Leaders Revealed About the State of FinOps in 2025 

In CloudBolt’s 2025 Industry Insights report “Performance vs. Perception: The FinOps Execution Gap,” based on a survey of 350 senior…