I am very excited to be able to introduce a feature that I know many vRealize Automation customers will find very useful when managing properties for their Cloud Assembly template designs, and that feature is Property Groups (currently available in vRealize Automation Cloud and vRealize Automation 8.3 on-prem versions and future on-prem versions as well).
Property Groups make it easy to set custom properties and reuse them in vRealize Automation’s Cloud Templates. You can quickly add a property group to Cloud Templates which saves the time of adding the same multiple properties one by one. In addition you have a single place to modify and create the properties for consistency and manageability.
There are two types of property groups:
- Input property groups are used for Cloud Templates inputs. These can include entries for the user to add or select when doing deployments
- Constant properties apply known properties to the resource and are invisible metadata. Examples could include license keys or even just regular property data that does not need to be secret.
The two property groups are handled differently in Cloud Assembly and I will show you how they both work in this blog. When you go into vRealize Automation Cloud Assembly you will see a new option under the Design tab called Property Groups, then you will see two options for group types we discussed earlier.
Let’s dig a bit deeper into each property group type.
Input Property Groups
Cloud Assembly input property groups usually include related settings for the user to enter or select. They might also include read-only values needed by the cloud template design. These will display on the request form when a deployment is initiated. Once you create the group you can add multiple inputs that the user will see at deployment time. In order to create a Input Property Group within Cloud Assembly go to Design > Property Groups and highlight the Input Values box.
To add a Property Group, click New Property.
I am going to create a new Input Property with two inputs available. One for Image and one for Size. I will use them to map to Image and Flavor mappings but you can choose any input types that you want as long as the values can correlate to the input.
Both of the values in the enum list will match some of my image mappings since that is where I will apply this input. I will also add another input within this group called flavor and I will allow those values to be chosen for Flavor property in the Cloud Template. Here is what the input property main page will look like when I am done.
Now the CorpInputs will be an available property group for me to assign as an input in my Cloud Template. So next step is for me to add this input to the inputs section of the Cloud Template so I can assign them. In order to add the input go to the Inputs section of the Cloud Template designer.
Then we can add the property group that was created by choosing Object –> Property Groups. Then you will see any input property groups you created. I gave the Cloud Template input the name “pgmachine” so that is what we will reference in the YAML code when assigning the input to a property.
Once the Input is added in the Inputs section, we can now see the Input in the YAML code within the Cloud Template and assign the Input and value (image and flavor) to the respective properties.
If you have a series of values in the input property group that the user will need to fill in for example, then you can add that to a single property by just referencing the entire property group only. So if have a input property group called “requester” and I have some inputs like, ’email’, ‘pin’, ‘mobile’, then I can just reference the requester group. It will look something like this in the YAML:
Then the form would look something like:
For now I am going to just stick with my inputs for image and mappings.
Now when I go to deploy this Cloud Template I will see the enum actions that we defined for the two input properties – image and flavor. If you recall for the image input, I chose Ubuntu-18 and CentOS as the options that will show up in the dropdown. You can see an example of that below.
After the deployment is completed you can view the inputs that were chose from the user at deployment time by going to the Deployment and clicking the History tab.
Constant Value Property Groups
Cloud Assembly constants allow you to silently apply known key-value pairs to your designs. The key appears in the cloud template code, and the value becomes part of deployments that are based on that cloud template. Constants require the
propgroup binding under the resource. The
propgroup binding is only used with constant property groups, not with input property groups. The process to create a Constant Value property group starts in the same place as the Input Property group, Design > Property Groups. From there click Constant Values and fill in the fields.
I am going to create a new Property Group that can be accessed from the Properties of a resource. These properties could include strings, integers etc. to provide values that can be used over and over again across your Cloud Templates. In this example I am setting AcctNum to “542316”. This will then be logged as a custom property and could potentially be a value accessed by an API call or used for extensibility.
After I have created the custom property, I can then add it to the YAML code of the Cloud Template. Constant property groups can only be added via code, there is currently not a method to add via the UI like inputs. The YAML code will look something like this referencing the
Then once the deployment is completed I can see the custom property within the Deployment and observe it was assigned to the virtual machine.
So as you can see creating Cloud Templates within vRealize Automation just got more flexible and powerful with this exciting new feature! Thanks for reading and look out for more blogs on this topic in the coming months.