Bug 1379303

Summary: Some predefined alerts send emails to incorrect recipient
Product: Red Hat CloudForms Management Engine Reporter: Dmitry Misharov <dmisharo>
Component: ControlAssignee: Lucy Fu <lufu>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: cpelland, dajohnso, gblomqui, jhardy, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: All   
OS: All   
Whiteboard: email:alert
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1392963 1392964 (view as bug list) Environment:
Last Closed: 2017-06-12 17:16:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1392963, 1392964    
Attachments:
Description Flags
Part of the evm.log none

Description Dmitry Misharov 2016-09-26 10:34:19 UTC
Created attachment 1204774 [details]
Part of the evm.log

Description of problem:
Predefined alerts "VM CPU count was decreased", "VM CPU count was increased", "VM Memory was decreased", "VM Memory was increased" send emails to incorrect recipient "evmadmin".

Version-Release number of selected component (if applicable):
5.7.0.2.20160921112913_c5ff117

How reproducible:
Always

Steps to Reproduce:
1. Navigate to Control->Explorer.
2. Expand Alerts accordion.
3. Edit "VM CPU count was decreased", "VM CPU count was increased", "VM Memory was decreased" or "VM Memory was increased" alert.
4. Tick "Active", "Notification Frequency" = 1 minute, add some email to recipients section.
5. Save the alert.
6. Create "VM and Instance" alert profile.
7. Add the edited alert.
8. Assign the alert profile to "The Enterprise"
9. Pick any VM and reconfigure it.
10. Change memory amount or CPU count depending of what alert you assigned to the alert profile.

Actual results:
There is no notification email about VM reconfiguring.

Expected results:
There should be notification email.

Additional info:
[----] I, [2016-09-26T05:10:32.182979 #2985:b95154]  INFO -- : MIQ(GenericMailer#prepare_generic_email) options: {:to=>"evmadmin", :from=>"evmadmin", :subject=>"Your virtual machine request has Completed - VM: dmisharo", :content_type=>nil, :body=>"Hello, <br><br>Your request to Reconfigure virtual machine dmisharo was approved and completed. <br><br> Thank you,<br> Virtualization Infrastructure Team", :sent_on=>2016-09-26 05:10:32 -0400}

Comment 3 CFME Bot 2016-11-07 16:56:33 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b20d623d31020f54f84ab463a07c72cde04f77c8

commit b20d623d31020f54f84ab463a07c72cde04f77c8
Author:     Lucy Fu <lufu>
AuthorDate: Wed Oct 12 15:27:57 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Oct 13 08:59:58 2016 -0400

    event_enforce_policy should be called for all policy events.
    
    event_enforce_policy does the policy resolution based on the policy events.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1379303

 .../System/Event/MiqEvent/POLICY.class/request_service_retire.yaml      | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml  | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/service_retired.yaml    | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_reconfigure.yaml     | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_retire_warn.yaml     | 2 ++
 5 files changed, 10 insertions(+)

Comment 4 CFME Bot 2016-11-07 18:21:19 UTC
New commit detected on ManageIQ/manageiq/darga:
https://github.com/ManageIQ/manageiq/commit/c71d782eea10b1ad0b5d45424e744d8e5ea8a300

commit c71d782eea10b1ad0b5d45424e744d8e5ea8a300
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Nov 7 11:53:15 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 7 13:18:17 2016 -0500

    Merge pull request #11884 from lfu/alert_email_recipient_1379303
    
    event_enforce_policy should be called for all policy events.
    (cherry picked from commit d137cfd21183401758769ab1d95d403aafb6d83d)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1379303

 .../System/Event/MiqEvent/POLICY.class/request_service_retire.yaml      | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml  | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/service_retired.yaml    | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_reconfigure.yaml     | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_retire_warn.yaml     | 2 ++
 5 files changed, 10 insertions(+)

Comment 5 CFME Bot 2016-11-07 23:06:23 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/5846cd5320db3073318f0543e5ea243668b06061

commit 5846cd5320db3073318f0543e5ea243668b06061
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Nov 7 11:53:15 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 7 18:05:28 2016 -0500

    Merge pull request #11884 from lfu/alert_email_recipient_1379303
    
    event_enforce_policy should be called for all policy events.
    (cherry picked from commit d137cfd21183401758769ab1d95d403aafb6d83d)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1379303

 .../System/Event/MiqEvent/POLICY.class/request_service_retire.yaml      | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml  | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/service_retired.yaml    | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_reconfigure.yaml     | 2 ++
 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_retire_warn.yaml     | 2 ++
 5 files changed, 10 insertions(+)

Comment 8 Dmitry Misharov 2017-03-02 15:47:39 UTC
Verified in 5.8.0.3.20170301174324_1e2e0c4. Alerts send email notifications when a vm has been reconfigured.