Event Broker Service
VRA generates many events and EBS provides a mechanism to respond to the events through VRO workflows. For example, when we request a catalog item the request VRA generates multiple events like Building Machine, Customizing, Power On etc. EBS enables us to run VRO workflows at these stages. It is similar to workflow stubs in 6.x but more elegant. Note: Though stubs are supported in VRA 7
In future releases it will be replaced by EBS
Event Topic: Events generated by VRA are categorized into “event topics” and every topic has a different schema. When an event is generated it carries data which can be consumed by consumer (VRO Workflow). The type of data it carries depends on which “event topic” it belongs to.
Schema from Machine provisioning event topic:
Schema from Pre-Approval:
Subscription: Subscription allows us to execute VRO Workflow based on the event. Workflow subscription consists of three parts
- Event Topic (For what events you want to run Workflow)
- Conditions (Run workflow for all events in the topic? Or you are interested in specific event? etc )
- VRO Workflow (Which VRO Workflow)
Let us see how EBS works and what data these events give to VRO
- Create a sample VRO Workflow (“Hello World”)
- Create Workflow Subscription
- Request VM
Create a sample VRO Workflow in vRO
Create HelloWorld workflow with no input parameters and arguments. When executed it logs message Hello world”. If you execute manually in VRO you don’t see any variables
Create Workflow Subscription
- Event topic: Machine Provisioning
- Conditions: Run for all events
- Workflow: Helloworld workflow created in previous step
Now publish the subscription and request VM
Now check workflow runs in orchestrator and can see event data in variables.
Workflow has run multiple times when it passes through the various states .
- VMPSMasterWorkflow32. VMPSMasterWorkflow32.EVENT.OnBuildSuccess
VRO Workflows : Synchronous or Asynchronous?
By default EBS runs VRO Workflows in fire and forget , it does not monitor/wait till workflow completes. If your requirement is like the request has to wait till VRO workflow is completed you can do so by clicking “Blocking” in subscriptions
Ok that’s cool, but how can I get the Blueprint properties to VRO workflow
Pass payload (blueprint properties) to VRO Workflow
To get the blueprint properties to VRO we need to
- Create property group BlueprintPayload and add the following parameters with value * ( Allowed values are Virtual*, __* and * )
Add the propertygroup to blueprint
- Download debug properties workflow from https://github.com/sammcgeown/vRA7-EBS-Examples/blob/master/debugProperties.workflow and thank https://github.com/sammcgeown for his awesome workflow.
Create new workflow subscription and link to debugProperties Workflow
- Request VM
- All the properties of blueprint can be seen in VRO Wokflow logs , select Debug in dropdown
Now you can extend the IaaS capabilities according to your business needs.No tags for this post.