vRealize Automation 7 – Enabling the Event Broker part 2

Well my hope is that you have already read through the Enabling the Event Broker that was posted in January. Then were thirsty for more and more around the Event broker. If you recall, in that post we covered the basics of consuming the payload from vRA 7 and utilize it just like we did the “Workflow Template” that used to exist in the 6.* days of vRA.

In the days since Enabling the Event Broker was posted I’ve built out some really powerful use cases as you can see by reviewing other more advanced Event Broker postings like Due to high demand, here’s the combined AAA deployment!, and New disk on a new SCSI adapter at request time. The issue is that it came to my attention by comments and customer meetings that I shouldn’t just be building out great use cases but enabling vRO template based examples.

So here we are with part 2 and in this post we will focus on Adding or Updating properties as the example. I will assume that you have followed the Enabling the Event Broker which will have your property groups already built out to pass all of the needed properties from vRA to vRO.

As I frequently do, if you want to follow along via video feel free to view this

***Note – You will notice there has been a bit of a change to my folder structure due to some standardization internally. Basically the team and I have decided that between us “Experts” (I use that term loosely) we will all build our content in a standardized layout so when you use stuff from Daily Hypervisor or VMtoCloud that you will have the same layout and limited reproduction of content.

While you can still use the examples from the original post you will likely get more out of the package I’ve posted here or here!

Then import into vRO and follow along step by step.

First let’s look at what’s included in the package you’ve downloaded.

Expand out the VMware -> SDE-SET -> Common -> vRealize Automation folder. In there you’ll find the folder we are going to base this post on. Expand Property Examples and the workflows you need for examples are all in this folder.



If we review the Add or Update properties for vRA example you’ll see the standard scriptable task which pulls in the payload (properties) and logs those. There are also 3 lines added to the end of that and an output of virtualMachineAddOrUpdateProperties with a type of properties. The benefit of this is that you can pass any number of value pairs back to vRA during the Event Broker execution.

virtualMachineAddOrUpdateProperties = new Properties ();
virtualMachineAddOrUpdateProperties.put(‘VirtualMachine.Network0.Name’, ‘dvPortGroup’);
virtualMachineAddOrUpdateProperties.put(‘custom.example’, ‘just a simple example’);
Reviewing these 3 lines you can see we are defining the property, updating an existing property, and creating a new property. These should help you as a starting point.



Now that we have looked at those to understand what’s going on let’s jump into vRA and work through the subscription. Go to Administration -> Events -> Subscriptions and +New



Select Machine provisioning



Run based on conditions

All of the following

Expand Data-Lifecycle state-Lifecycle state name



Equals and I’m choosing BuildingMachine as the example but this could be used at any of the events



Expand Data-Lifecycle state-State phase



Equals and I chose POST for the example



Choose your workflow “Add or Update properties for vRA”



IMPORTANT Select Blocking this is the only way vRA will accept the output from vRO to add or update properties



Publish the subscription you just created



Now time for some verification work. Based on Enabling the Event Broker you should have a trigger on all events subscription if not repeat the steps above and make sure this is published.



This is the walk through to verify you have something collecting the payload at every event



Run on all events



Get properties (don’t worry it’s just logging so we can verify the add or update worked)



Doesn’t need to block, but make sure it’s PUBLISHED



Now all you need to do is put the request for your catalog item in and let’s look at the workflows as they execute.

First we look at the event on request and notice there are no custom.example



And our VirtualMachine.Network0.Name is set to VM Network



When our Add or Update is kicked off we can see it successfully ran



Now let’s look at the logs collected after the Add or Update was run

Notice we now have a custom.example (Which was created)



And our VirtualMachine.Network0.Name is set to dvPortGroup



I chose these very specifically to illustrate something that you likely have or could use in your environment but mostly I wanted to provide you with a sampling of what you can accomplish and how much easier it is than the good ole days of v.6

Having completed this and previously completed the Enabling the Event Broker you should now be able to collect and update any of the custom properties in vRA 7 using the Event Broker!

As always please let me know any feedback, thoughts, concerns, or kudos.



1 ping

Skip to comment form

    • Dan on May 3, 2016 at 10:08 am
    • Reply

    Hey Gary, has anyone mentioned any issues around downloading the sdeset package? When importing it, I get an “invalid block type” error in vRO. Thanks!

    1. Tested on 7.01, what version are you running?

        • Dan on May 3, 2016 at 11:47 am
        • Reply

        Should be 7.0.1 as it’s the one nested in our vRA 7.0.1

        1. Do me a favor and try this one. I think it may be an issue with sample exchange.

        2. Can you try this package? I believe we may have an issue with developer center. https://www.dropbox.com/s/rngu9tzl93gogjm/com.vmware.sdeset.vra.workflowTemplates.package?dl=0

            • Dan on May 3, 2016 at 12:03 pm

            That one worked as expected, thanks!

    • Itrudeau on May 5, 2016 at 3:06 pm
    • Reply

    Hello, I trying to used this method to rename the VM Name at the Pre BuildMachine Phase whit a custom name generated by a name generator from a web App REst API Call.

    Using this the methode list bellow:

    virtualMachineAddOrUpdateProperties = new Properties ();
    virtualMachineAddOrUpdateProperties.put(“Name”, VMNewName);

    is the new name generated by the web app Rest API Call workflow result.

    This not seams to be working because I cannot see the VM Name change wen deploy and part of the Item list.

    Do you have any idea what I missing ?

    1. Based on my testing you can only do this at Requested Post. That should work for you as long as you have the subscription set to block

        • Itrudeau on May 13, 2016 at 5:01 pm
        • Reply

        Wow that work as you said. Now I was strungleling for week trying to figured this out.

        Very appreciate you help on this.


        1. I’m very glad these have helped you over come any learning challenges you may have been having. Stay tuned for even more content my friend!

    • Dan on May 11, 2016 at 9:21 pm
    • Reply

    Gary, have you seen it where the payload isn’t even passed to the workflow?

    1. Typically that is due to the custom property not being assigned to the blueprint. Make sure the appropriate property is assigned for your state change.


        • Dan on May 12, 2016 at 8:48 am
        • Reply

        We have both the custom property and the *.Requested in place. What’s odd is we can choose between two different workflows to run in the event; one receives a payload and the other does not.

        1. More than willing to jump on a webex with you if you’d like to demonstrate the behavior. That said is this 7.0.1 fresh install or upgrade? Are both blocking tasks? Can you disable the one that’s successfully running now and see if the one not working will pull the payload?

    • skraack on June 30, 2016 at 3:25 pm
    • Reply

    Is there a particular state requirements for updating any of the “__” hidden properties? I am trying to add some data to the __Notes field and it does not seem to be working at MachineProvisioned PRE or POST. I am able to update and create standard custom properties though. Any suggestions?

    1. Skraack, Not sure what you’re running into. I just tested in my environment and at Requested and phase of PRE I just set the __Notes as expected.

      Here’s the vRO code I used
      virtualMachineAddOrUpdateProperties = new Properties ();
      virtualMachineAddOrUpdateProperties.put(‘__Notes’, ‘Test’);

      Make sure your subscription is blocking

        • skraack on June 30, 2016 at 4:15 pm
        • Reply

        Trying to do it in a later state when I have more data. Requested is too early in the process.

        • skraack on June 30, 2016 at 4:32 pm
        • Reply

        Now I see what is happening. I am trying to update the VM Description field and I assumed that the __Notes was it, but it looks like Description is a copy of __Notes. I guess I will have to update the vCAC entity to get the description to update in VRA. Thought there might be a shortcut there, but I guess not.

        1. If you’re attempting to update the description of the actual deployment then that may be a bit of a challenge. I’m not sure that the vCAC entity will even do it. Since the Event Broker doesn’t allow for any interaction at the deployment level I have only seen that updated via an API call. Take a look at http://dailyhypervisor.com/vrealize-automation-custom-hostnaming-extension/ for the example to jump off of.

    • ong yc on October 25, 2016 at 12:05 pm
    • Reply


    can this be sent back to VRA? cant grab the profile

    1. Yes you can force settings back to vRA simply by making the event blocking and having the vRO workflow set a properties output. Take a look at this much older video as the example. http://screencast-o-matic.com/watch/coX2nOhDqD

    • Suresh on September 15, 2017 at 5:37 am
    • Reply

    Hi Gary,

    I am unable to retrieve _number_of_instances payload property value, if I set deployment limit to 1 or set it to any maximum number it will fail to retrieve instance value. If I remove value from deployment limit as blank, then I am able to get properties value for _number_of_instances. Could you please let me know how can I retrieve value if I set deployment limit.

    Thanks & Regards,

    1. Suresh, Sadly I believe this is a bug that you will want to open a ticket with VMware.

  1. […] Check out part 2 […]

Leave a Reply

Your email address will not be published.