Custom Property based filtering in vRA8

Share on:

Recently I have been looking into a way to create environment independent filters in Aria Automation extensibility. Transferring content between multiple vRA instances is quit easy using the content management functionality in VMware Aria Suite Lifecycle (VASL). The content management functionality however doesn’t adapt the extensibility subscriptions filters to match the Id’s of the new vRA instance. Hence manual work is still needed to adapt the filters when your for example filtering based on blueprintId.

A vRA subscription can be configured with a filter to limit when its being executed based on the event data. To execute the event subscription only for a specific cloud template a filter based on the blueprintId can be used.

1event.data.blueprintId == '<some blueprint uuid>'

This filter is however not automatically adapted to the new blueprintId when transferring cloud templates and subscriptions using VASL to a new environment. Ideally we would be able to filter based on the cloud template name but this is however not possible as this information is not passed in the event data.

To not have to change the filters when working with multiple environments, it’s better not to use any of the id’s available in the event data in the extensibiility filters. Instead the custom properties defined in the cloud template can be used to generalize the subscription filter. The custom property based filters need to be specified as below.

1event.data["customProperties"]["<Some custom property>"] == '<custom property value>'

There is however a difference how vRA handles this type of subscription filter compared to filtering based on blueprintId. A subscription with a filter based on the blueprintId will be executed once for a deployment of a blueprint. The execution contains the information about all resources deployed by this cloud template.

A subscription with a filter based on the custom property will be executed only for the resource(s) on which the custom property was defined on the cloud template. When you need to execute the subscription for multiple resources you will need to specify the custom property on each of the resources in you cloud template. The execution context available to the workflow/ABX action contains hence only the information of the resource for which its triggered, not the information of all resources deployed by the deployment.