{% raw %}
Overview
This overview will help to utilize Property Toolkit mixed with the Sovlabs Template Engine to dynamically build a vRealize Custom Property.
For an example, this guide will go over dynamically generating the value for the VMware.VirtualCenter.Folder property.
https://docs.vmware.com/en/vRealize-Automation/7.5/vrealize-automation-75-custom-properties.pdf
Property: VMware.VirtualCenter.Folder Description: Specifies the name of the inventory folder in the data center in which to put the virtual machine. The default is VRM, which is also the vSphere folder in which vRealize Automation places provisioned machines if the property is not used. This value can be a path with multiple folders, for example productionemail servers. A proxy agent creates the specified folder in vSphere if the folder does not exist. Folder names are case-sensitive. This property is available for virtual provisioning. |
Considerations
This example procedure will apply the set property based off two different custom properties present within the vRA environment. In addition, the properties contained within this guide can be replaced with other static values or built in vRA Custom Properties
Your SovLabs plugin license must include Property Toolkit.
Requires SovLabs vRA Extensibility modules plugin version 2018.2.7 or higher.
Procedure
Determine the variables to be used in the Dynamic Property Group
- Log into the vRA environment and determine the properties that are going to be utilized to build the value for VMware.VirtualCenter.Folder
-
Table of Properties
PropertyValueDescriptionnamingUsage
DEVCustom Property Used as a selection in the blueprint which is used already for custom naming created for the Sovlabs Naming Sequence to determine the Usage of the servernamingAppType
APPCustom Property Used as a selection in the blueprint which is used already for custom naming created for the Sovlabs Naming Sequence to determine the Application Type of the server
-
- As these are properties that are already gathered as part of naming, they are inserted on the blueprint and need to be selected by the end user. These same properties could be set at other layers, such as Business Group, Reservations, or Endpoints and be set with static values
Create the Dynamic Property Group
- In vRA, create a new Property Group located in Administration>Property Dictionary>Property Group
- Name the group, starting with SVL_ , with a unique value
- In the below example we created SVL_vCenterFolder (Be sure to include the underscore between SVL and your unique name)
- In the below example we created SVL_vCenterFolder (Be sure to include the underscore between SVL and your unique name)
Create the Custom Property and Template Engine Code Value inside the New Property Group
- Edit the new property group and create a new property
- Name the property VMware.VirtualCenter.Folder
- For the value field, insert the properties to evaluate to dynamically create the value. The values can be modified and manipulated using the Sovlabs Template Engine
- Value: {{namingUsage}}{{namingAppType}}
-
Code Breakdown
Code Value Description {{namingUsage}} DEV Calls the value set for the namingUsage property Verbatim insertion of a between the two properties {{namingAppType}} APP Calls the value set for the namingAppType property -
The above example would result in a path of DEVAPP
-
- Value: {{namingUsage}}{{namingAppType}}
Apply the SVL Property Group as a Custom Property
Apply to any layer using a property definition
The SVL property group MUST be applied as a Custom Property with the value being the same name. This can be assigned on any layer, such as blueprints, reservations, business groups, and endpoints. In this example, we will add it to the Business Group layer
- In vRA, navigate to Administration>Users & Groups>Business Groups
- Edit the Business Group and in the Custom properties pane in the General tab click New
- Insert a new property that is named the same as the SVL Property Group
- Insert the value of the new property to match the name
- By adding it to a Business Group layer, it will ensure that this property will be triggered for all builds that are contained within that Business Group
{% endraw %}