«

»

Jun 13

vRealize Automation 7 – Custom Email Notifications with the Event Broker part Duex

 

As promised from a few weeks ago I set out to solve the one hole I’ve found with the event broker in vRA 7. As you all know if you read vRealize Automation – Custom Email Notifications with the event broker there are lots of great ways deal with custom html notifications. The event broker exposes all of these phases to take advantage of, the issue of course is that the event broker is only part of those lifecycle phases and doesn’t tie into software components today.

Now with that said it’s important to note that I’m working with our PM team and we should see this as well as a few other gaps solved in the next major release. So with this session my goal is to enable you to utilize the custom email notifications we worked with before and provide a quality work around that will give you the ability to write an html file and then post software deployment provide an approval (again based on EB) to send the written file.

Take a gander at the video.

 

 

You can download the package used here from this link

NOTE: If you haven’t yet looked into it I highly recommend looking at the installer package like I’m using here, it makes life much easier and will be my standard delivery of packages moving forward

Once you have the package imported expand the folder VMware -> SDE-SET -> vRealize Automation -> Custom Notifications.

In this folder run the Install Custom Notifications – Post Approvals

This will execute the configuration of your SMTP settings and initiate the file write and read event subscriptions

01-custom-email-notifications--2mp4

 

First is the event subscriptions – You may leave the defaults here

02-custom-email-notifications--2mp4

 

Next is the SMTP server settings

03-custom-email-notifications--2mp4

 

Now we can review the write file code and edit as needed

04-custom-email-notifications--2mp4

 

This is the block that you will want to customize for your html file configuration

05-custom-email-notifications--2mp4

 

Next we look at the read file, nothing will need to be edited here but it is something worth reviewing as it has an approval built into it

06-custom-email-notifications--2mp4

07-custom-email-notifications--2mp4

 

From this point forward we can work in the vRA web UI. Start with the Administration -> Events -> Subscriptions, you will see the two workflows we setup with the installer.

08-custom-email-notifications--2mp4

 

Next we need to build an approval policy, go to Administration -> Approval Policies -> Add a new policy and select service catalog – catalog item request

09-custom-email-notifications--2mp4

 

Provide a name, set Status to Active, click Post Approval and + to add a new level

10-custom-email-notifications--2mp4

 

Name the new level, require for all events, and use event subscription

11-custom-email-notifications--2mp4

 

Now that we’ve created the approval policy we just entitle it to the specific software components. I am using my cloud admins entitlement.

12-custom-email-notifications--2mp4

 

Items & Approval and I have my software components in a service offering. I suggest you do the same then only these specific blueprints will trigger the approval email. Modify the Policy

13-custom-email-notifications--2mp4

 

Select the newly created policy

14-custom-email-notifications--2mp4

 

 

Now you can go request your service and will get the email notifications after the software components complete!

8 comments

Skip to comment form

  1. Cameron

    Have you looked into setting up an approval/reject email template using Event Broker? The templates that gets emailed out is very limited and the kb provided by VMware is just about unusable. My management would like to see more server details like how much more CPU/RAM/Storage is being requested so they don’t have to go into the vRA appliance to see what they are approving.

    1. gary.coburn

      You could utilize the work done on this post to populate and send the post approval information but not actually pass an approval as the output

  2. Hag

    My event broker was working then all of a sudden started throwing:
    [2016-11-05 15:34:16.622] [I] IP = null
    [2016-11-05 15:34:16.623] [I] OS = null
    [2016-11-05 15:34:16.624] [I] ipUrl is undefined
    [2016-11-05 15:34:16.882] [E] Error in (Workflow:Send custom notification – State Transition / Get Properties and apply logic (item1)#51) {
    “error”: “invalid_grant”,
    “error_description”: “Invalid username or password”
    }
    [2016-11-05 15:34:16.918] [E] Workflow execution stack:
    ***
    item: ‘Send custom notification – State Transition/item1’, state: ‘failed’, business state: ‘null’, exception: ‘{
    “error”: “invalid_grant”,
    “error_description”: “Invalid username or password”
    } (Workflow:Send custom notification – State Transition / Get Properties and apply logic (item1)#51)’
    workflow: ‘Send custom notification – State Transition’ (c2c85ba9-237c-4b29-94fc-67f0901fa55d)

    1. gary.coburn

      The fact that you’re getting null values it appears to me that you don’t have the property defined on the actual blueprint. Remember you will need the blueprint to have the custom property defined at the state you are running this.

  3. Sivakumar

    Can such a thing be done for the approval mails? Other than modifying templates, I mean. Thanks

    1. gary.coburn

      Yes absolutely you can use pre/post approval to trigger workflows.

  4. Susan

    How to use pre/post approval to trigger workflows?
    Thanks for your help!

    1. gary.coburn

      Are you looking for a post on utilizing the pre/post approval workflows? As of 7.1 there were still many challenges as you can see with this event broker work, not all of the event data got passed to the pre or post approvals. I’m not entirely sure if this was solved in 7.2

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>