VMware Cloud Community
Joffer
Enthusiast
Enthusiast

vRA 7.1 email templates problem(s)

We seem to have problems getting vRA 7.1 email templates to work. Are there changes between 7.0.x and 7.1?
We've downloaded the vRA 7.0 template files (2102019_vrealize_automation_70.tar.gz) found in KB2102019 while following the instructions to install it (scp, unpack, fix permissions - KB2088805). (We upgraded from vRA 7.0.1 to 7.1.0. There are no internet access on the hosts).

Before we extracted and installed the template files, we get a standard notification email. After the files were installed on the vRA appliance VM, and vcac-server restarted, the emails stops sending.

Looking in the /storage/log/vmware/vcac/catalina.out log we find these errors:
06 Sep 2016 10:19:01,370 [velocity] (queue-pool-executer-2) () ERROR: ResourceManager : unable to find resource 'core/subject.vm-csp.catalog.notifications.request.submission' in any resource loader.
06 Sep 2016 10:19:01,374 [velocity] (queue-pool-executer-2) () ERROR: ResourceManager : unable to find resource '../displayDisks.vm' in any resource loader.
06 Sep 2016 10:19:01,374 [velocity] (queue-pool-executer-2) () ERROR: #parse(): cannot find template '../displayDisks.vm', called at core/main.vm-csp.catalog.notifications.request.submission[line 4, column 1]
2016-09-06 10:19:03,312 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="d6l0ouoS" token="kdYbn9ln"] com.vmware.vcac.platform.service.integration.ErrorRequestListenerActivator.onErrorMessageRequest:43 - Failed message with id [91a8a95d-716b-4491-29db-3424a67c0f00] accepted for error processing.
Error Message: [nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '../displayDisks.vm'].
Message: [GenericMessage [payload=RichNotification [recipientId=k98183@skead.no, notificationId=6588324e-6d71-448a-85da-a39f73f6c324, notificationProviderId=269d980f-c4db-4382-8d63-02644ddfbf68], headers={NotificationProviderType=EMAIL_PROVIDER, trace-id=d6l0ouoS, id=91a8a95d-716b-4491-29db-3424a67c0f00, timestamp=1473149941309}]]
org.springframework.messaging.MessagingException: nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '../displayDisks.vm'
        at com.vmware.vcac.platform.service.integration.BaseServiceActivator.handleMessage(BaseServiceActivator.java:23) ~[platform-integration-7.1.0-SNAPSHOT.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_102]
        ... (I've removed all the extra lines)
        at com.vmware.vcac.notification.events.EmailNotificationListenerImpl.onMessageReceived(EmailNotificationListenerImpl.java:87) ~[classes/:?]
        at com.vmware.vcac.platform.service.integration.BaseServiceActivator.handleMessage(BaseServiceActivator.java:20) ~[platform-integration-7.1.0-SNAPSHOT.jar:?]
        ... 46 more

Editing core/defaults/main.vm and replacing

#parse( '../displayDisks.vm' )
#parse( '../displayNetworks.vm' )
#parse( '../displayResources.vm' )

with

#parse( 'extensions/displayDisks.vm' )
#parse( 'extensions/displayNetworks.vm' )
#parse( 'extensions/displayResources.vm' )

and also adding a simple text line ("parsed <filename>") to the very bottom of each of those extentions template files verified that the files are now parsed, as we yet again get email notification(s). But now the rest of the content aren't parsed.. A simple XaaS catalog item resulted in an email with this content:

<email content>
parsed displayDisks.vm
parsed displayNetworks.vm
parsed displayResources.vm

Request Information 
#renderRow("notification.email.extensions.deployment", "#valueOf('catalogItem-Name')")
#renderRow("notification.email.extensions.action", $resourceAction_Name)
#renderRow("notification.email.extensions.request.requestedBy", "#valueOf('requestedBy')")
#renderRow("notification.email.extensions.request.requestDate", "#valueOf('requestedDate')")
#renderRow("notification.email.extensions.description", "#valueOf('description')")
#renderRow("notification.email.extensions.request.reason", "#valueOf('reasons')")
#renderRow("notification.email.extensions.request.numberOfInstances", "#valueOf('_number_of_instances')")
#renderRow("notification.email.extensions.request.leaseCost", "#valueOf('requestLeaseCost')")
#renderRow("notification.email.extensions.request.leasePeriod", $request_leasePeriod)
#renderRow("notification.email.extensions.request.totalCost", "#valueOf('requestTotalLeaseCost')")

Click here to view details
</email> (last line is a link)

All things renderRow macro and valueOf aren't parsed. 

Source of information for installing the email template files:
Examples for customizing email templates in VMware vRealize Automation (2102019)
Customizing email templates in VMware vRealize Automation (formerly known as VMware vCloud Automatio...

Please advice on how to get the 'body' of the emails to render with template files installed.

PS! It would be nice to get the tar-gzip file without the OSX meta files included (.DS_Store and all the ._<existing_file_name>) but thats for another day/VMware to fix

0 Kudos
2 Replies
Joffer
Enthusiast
Enthusiast

Reply from VMware support said the email templates wasn't supported in 7.1.0, and that the KB article will be updated to reflect that.

Ugh.. 

0 Kudos
Joffer
Enthusiast
Enthusiast

VMware has released a new blog article about templates in vRA 7.0/7.1, also with new files for vRA 7.1 🙂

I have not tried them yet, but here's the link: https://blogs.vmware.com/management/2016/09/email-customization-vra.html

0 Kudos