Property Toolkit - Create and Assign a Custom Property

Overview

This overview will help to utilize Property Toolkit and 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.


vRealize 7.6 Custom Property Reference

https://docs.vmware.com/en/vRealize-Automation/7.6/vrealize-automation-76-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 production\email 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


Procedure

Determine the variables to be used in the Dynamic Property Group

  1. Log into the vRA environment and determine the properties that are going to be utilized to build the value for VMware.VirtualCenter.Folder
    1. Table of Properties

      PropertyValueDescription

      namingUsage

      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 server

      namingAppType

      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

  2. 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

  1. In vRA, create a new Property Group located in Administration>Property Dictionary>Property Group
  2. Name the group, starting with SVL_ , with a unique value
    1. 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

  1. Edit the new property group and create a new property
  2. Name the property VMware.VirtualCenter.Folder
  3. 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
    1. Value: {{namingUsage}}\{{namingAppType}}
      1. Code Breakdown

        CodeValueDescription
        {{namingUsage}}DEVCalls the value set for the namingUsage property
        \\Verbatim insertion of a \ between the two properties
        {{namingAppType}}APPCalls the value set for the namingAppType property

      2. The above example would result in a path of DEV\APP

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

  1. In vRA, navigate to Administration>Users & Groups>Business Groups
  2. Edit the Business Group and in the Custom properties pane in the General tab click New
  3. Insert a new property that is named the same as the SVL Property Group
  4. Insert the value of the new property to match the name
  5. 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


Additional information


Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.