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
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
First is the event subscriptions – You may leave the defaults here
Next is the SMTP server settings
Now we can review the write file code and edit as needed
This is the block that you will want to customize for your html file configuration
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
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.
Next we need to build an approval policy, go to Administration -> Approval Policies -> Add a new policy and select service catalog – catalog item request
Provide a name, set Status to Active, click Post Approval and + to add a new level
Name the new level, require for all events, and use event subscription
Now that we’ve created the approval policy we just entitle it to the specific software components. I am using my cloud admins entitlement.
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
Select the newly created policy
Now you can go request your service and will get the email notifications after the software components complete!
12 comments
Skip to comment form
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.
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
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)
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.
Can such a thing be done for the approval mails? Other than modifying templates, I mean. Thanks
Yes absolutely you can use pre/post approval to trigger workflows.
How to use pre/post approval to trigger workflows?
Thanks for your help!
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
Hi Gary,
In vRA7.3 is there a way to get the “Parent ID” when provisioning a blueprint with multiple VMs and the Edge device? We are trying to capture the external IPs of the VMs that get deployed and put it in an email. We are able to get the external IPs when we run it against the VM, but we need to get it for all of the VMs in the blueprint.
In our VCAC 6.2 environment we have a workflow that is able to use the “Parent ID” that was in the SQL DB, but the “Parent ID” is not in the SQL DB and now resides in the Postgres DB. Also the “Container ID” is used for Containers. I would like use the “payload” variable and list all the keys during deployment so we can pick what we are looking for and create the loop in our script within the workflow. IF you know where the “Parent ID” is, that would be helpful too.
Thanks,
John
P.S. we spoke at VMworld 2016 in one of your small sessions.
Author
John,
My apologies, I don’t have the 7.3 knowledge to get the Parent ID. Based on other details I’ve heard through dailyhypervisor.com and others the Parent ID is only available via REST API which means it’s not part of the payload. Sorry I couldn’t be more help 🙁
Gary, have you heard anymore if this issue has been addressed in 7.3?
Author
My experience is drifting further and further away from this, but the last knowledge I have of 7.3 is that it still doesn’t solve this problem 🙁