One of the interesting enhancements of vRealize Automation 7 is the event broker. The event broker is responsible for starting vRealize Orchestrator workflows as part of a blueprint deployment, day 2 operations, configuration of blueprints, custom approvals and more. The event broker is the replacement of the workflow stubs feature, that was part of vRA 6.x (and still is in vRA 7) which allowed you to start a vRO workflow as part of a virtual machine deployment process.
The new event broker is far more flexible, and allows you to start different vRO workflows, synchronously or a-synchronously. You can set priorities and configure if a workflow is blocking or non-blocking. If you’re completely new to the event broker, you might want to read this article on virtualviking.net.
You can filter when a vRO workflow is started by using so called “conditions”. In this way you can configure a workflow to only run in the BuildingMachine phase, or you can link a certain workflow to a specific blueprint. It’s also possible to run a workflow based on the value of a (user defined) custom property. To achieve this, take the following steps:
- Set and configure the custom property;
- Set the “Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32” property for the workflow name state you want to use in the event broker.
- Configure a ${data~machine~properties~SomeCustomProperty} condition in the event broker.
Let’s have a closer look at these three steps.
Configure a custom property
This is a quite easy, just define the custom property you want to use and set it on the virtual machine you want to deploy (using a property group optionally). For example set custom property viktorious.os = “windows” for a virtual machine that’s running Windows :).
Pass custom properties to the event broker
By default the event broker can only work with a pre-defined payload. This payload doesn’t contain user-defined custom properties. Because of this you cannot filter on custom properties, because the custom properties are just not available in the event broker. However, by adding the special custom property Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Buildingmachine = “*” to a virtual machine (or property group that’s linked to a virtual machine), you tell vRA it has to send custom properties to the event broker. The * is a wildcard, you can also configure Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Buildingmachine = “viktorious.*”, which will only sent custom properties starting with viktorious to the event broker.
Note: Read more about the available extensibility custom properties here.
Configure the condition
The last step is to configure the condition in the event broker. In the event broker you can use the special filter option ${data~machine~properties~SomeCustomProperty}. For the custom property viktorious.os, the filter option would be ${data~machine~properties~viktorious.os}. Now just set the exact condition, for example:
${data~machine~properties~viktorious.os} equals windows
This condition will only run the workflow, when the custom property viktorious.os is windows for a particular virtual machine that is deployed. In this way it’s possible to set conditions based on user-defined custom properties.
7 Comments
Pingback: Available extensibility custom properties in vRA 7 - techunplugged.io
Matt
Helpful article, Viktor.
One thing I’ve noticed in vRA 7.2 event subscriptions, you only seem to be able to use custom property expressions in the top 2 levels of nesting. Below that, you don’t get the text box with the green checkmark to enter the name of the custom property.
i.e. This works:
Single Condition
Data>Machine>Properties>viktorious.os equals windows
And this works:
All of the Following
Single Condition
Data>Machine>Properties>viktorious.os equals windows
etc.
But unable to get this to work, there is nowhere to enter the property name.
All of the Following
Any of the Following
Single Condition
Data>Machine>Properties>viktorious.os equals windows
etc.
Is there a trick? Is this a known limitation?
I have a situation where would be useful to be able to do this.
Thanks
Matt
viktorious
Hi Matt, thanks for your comment. And to be honest, I ran into exactly the same issue at a customer vRA implementation. I’ve been looking for a solution or workaround, but haven’t found anything. I will ask around in my network, maybe someone can help. Will let you know when I find a solution for this!
Matt
Ok, not just me then. Too bad.
Thanks for the quick reply. Will follow up if I come up with something at my end.
Cheers.
Andrea
Is there a way to delay disposing of a failed build.
We have a EB that runs the dispose of the server however there are times when we would like to not dispose of the server for 24 hours.
viktorious
Maybe this helps you: http://www.virtualizationteam.com/cloud/vcac-not-to-delete-vms-after-deployment-failed.html
Phyo
Hi viktorious,
How can we define the condition that the event broker should run if the user-defined custom property value is present (not empty) ?