VRA Event Broker Service (EBS)

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

  1. Event Topic (For what events you want to run Workflow)
  2. Conditions (Run workflow for all events in the topic? Or you are interested in specific event? etc )
  3. VRO Workflow (Which VRO Workflow)

Let us see how EBS works and what data these events give to VRO

  1. Create a sample VRO Workflow (“Hello World”)
  2. Create Workflow Subscription
  3. 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

Administration->Events->Subscriptions->New

  • 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.Requested
  • VMPSMasterWorkflow32.WaitingToBuild
  • CloneWorkflow.CloneMachine
  • VMPSMasterWorkflow32.BuildingMachine
  • CloneWorkflow.CustomizingMachine
  • CloneWorkflow.InitialPowerOn
  • CloneWorkflow.CustomizeOS
  • CloneWorkflow.BuildComplete.
  • VMPSMasterWorkflow32. VMPSMasterWorkflow32.EVENT.OnBuildSuccess
  • VMPSMasterWorkflow32.BuildingMachine
  • VMPSMasterWorkflow32.MachineProvisioned
  • VMPSMasterWorkflow32.MachineActivated

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

 

  1. Create property group BlueprintPayload and add the following parameters with value * ( Allowed values are Virtual*, __* and * )
  • Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Rebooting
  • Extensibility.Lifecycle.Properties.CloneWorkflow.CustomizeMachine
  • Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine
  • Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Requested

  1. Add the propertygroup to blueprint

     

  2. 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.
  3. Create new workflow subscription and link to debugProperties Workflow

  4. Request VM
  5. 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.

Request VM using VRA7 REST API - VMWare vRealize Automation
Integrate vRA and vRO
No tags for this post.

Leave a Comment