Bug 1422208 - When provisioning VM, multiple emails with same content are sent
Summary: When provisioning VM, multiple emails with same content are sent
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: William Fitzgerald
QA Contact: Jan Zmeskal
URL:
Whiteboard: provider:rhev
Depends On:
Blocks: 1460031
TreeView+ depends on / blocked
 
Reported: 2017-02-14 18:08 UTC by movciari
Modified: 2023-09-14 03:53 UTC (History)
9 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1460031 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:26:49 UTC
Category: Bug
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description movciari 2017-02-14 18:08:41 UTC
Description of problem:
When provisioning a VM in our automated tests, CFME sends multiple emails with same text:
"""
Hello, 

Your request to Reconfigure virtual machine test-provt-wenw001 was approved and completed. 

 Thank you,
 Virtualization Infrastructure Team
"""


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

How reproducible:
always

Steps to Reproduce:
1. Provision VM
2. Wait for VM to be provisioned
3. Check emails

Actual results:
Sends multiple emails with the same content at the same time

Expected results:
Should send each email only once

Additional info:
We reproduced this when using RHV 4.0 provider, not sure about other providers
Detailed reproduction steps can be found in integration tests in file:
cfme_tests/cfme/tests/infrastructure/test_provisioning.py function test_provision_approval

Comment 2 William Fitzgerald 2017-02-21 15:38:33 UTC
Hello,

Can I get access to your logs and if possible your appliance.

Thanks

Billy

Comment 3 movciari 2017-03-02 09:26:09 UTC
Appliance no longer exists, but we can create a new one and reproduce it if really needed. I will attach logs from automation.

Comment 5 William Fitzgerald 2017-03-02 21:49:15 UTC
I can't find the logs in the attachment. Can you please send the /log directory or tell me where the logs are in the attachment.

Thanks

Billy

Comment 6 William Fitzgerald 2017-03-17 14:38:41 UTC
I can't find the logs in the attachment. Can you please send the /log directory or tell me where the logs are in the attachment.

Thanks

Billy

Comment 8 William Fitzgerald 2017-03-27 18:31:31 UTC
Thank you for access to your appliance and logs. It appears that we are sending out multiple Reconfiguration emails in addition to the normal provisioning email you should receive.  Hoping to get back into your appliance and look at this in more detail.
Is your appliance still available ?

Billy

Comment 9 movciari 2017-03-28 09:10:24 UTC
We have some problems in the environment with this appliance. I will try to fix those and give you access to the appliance again

Comment 10 Oved Ourfali 2017-05-16 07:00:09 UTC
William - any progress on that one?

Comment 11 William Fitzgerald 2017-05-16 17:05:26 UTC
The problem only seems to happen under certain conditions and I am trying to re-create the problem now.

Can you re-create this problem and let me have access to your appliance ?

This would help.

Thanks

Billy

Comment 12 William Fitzgerald 2017-05-17 15:55:32 UTC
I was able to re-create this issue so I don't need access to your appliance.

Thanks

Billy

Comment 14 CFME Bot 2017-05-17 17:48:59 UTC
New commit detected on ManageIQ/manageiq-content/master:
https://github.com/ManageIQ/manageiq-content/commit/ef811fc45a6c681e0e8c9cbd4539f05101475dbb

commit ef811fc45a6c681e0e8c9cbd4539f05101475dbb
Author:     william fitzgerald <wfitzger>
AuthorDate: Wed May 17 12:14:25 2017 -0400
Commit:     william fitzgerald <wfitzger>
CommitDate: Wed May 17 12:14:25 2017 -0400

    Remove VM reconfiguration email.
    
    Removed vm_reconfigure email from System/Event/MiqEvent/Policy instance.
    This event is being called sometimes when provisioning.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1422208
    
    @miq-bot add_label bug, fine/yes

 .../ManageIQ/System/Event/MiqEvent/POLICY.class/vm_reconfigure.yaml     | 2 --
 1 file changed, 2 deletions(-)

Comment 16 Jan Zmeskal 2018-01-15 07:58:06 UTC
Hi William,

do you still remember which specific conditions lead to the reproduction of this? I have run test_provision_approval few times on our CI and it looks okay. But it was a generic environment.

Jan

Comment 17 William Fitzgerald 2018-01-15 15:16:00 UTC
Jan,

There is a good talk topic about this. 

http://talk.manageiq.org/t/unwanted-email-on-vmreconfigure-task-complete/1653

"I’ve seen this with a clone from template provision into a RHEV provider, where the resulting VM has a slightly different configuration from the template (for example more CPUs or memory). It seems that the VM provision task creates the initial VM clone, and then a separate VM reconfiguration task is queued to update the CPUs or memory in the new VM to the values in the original request."

How this helps.

Billy

Comment 18 Jan Zmeskal 2018-02-02 09:01:32 UTC
Verified on:
CFME 5.9.0.18

Verification steps:
1. Go to Compute -> Infrasructure -> Virtual Machines
2. Lifecycle -> Provision VMs
3. Choose template
4. Fill in e-mail address
5. In Catalog, choose "Native Clone" as a Provision Type
6. In Catalog, choose 3 as Number of VMs
7. In Catalog, fill in VM name
8. In Environment, check "Choose Automatically" as Placement
9. In Hardware, make the Cores per Socket and Memory different from default
10. Choose Network
11. Submit
12. If you have a quota set, the request won't get auto-approved. Approve it manually.
13. Wait until all requested VMs are provisioned and inspect incoming e-mails.

Results:
I received altogether 6 e-mails.
1st subject: 'Request ID 75 - Your Request for a new VM(s) was not Auto-Approved'
2nd subject: 'Request ID 75 - Virtual machine request was not approved'
3rd subject: 'Request ID 75 - Your Virtual Machine configuration was Approved,\n pending Quota Validation'
4th, 5th adn 6th subject: 'Your virtual machine request has Completed - VM:\n <vm_name>'

Discussion:
So the original bug is not seen there, that's for sure, therefore moving to verified. However I have couple of questions:
1) Do we want want to send one e-mail that says the request was not auto-approved and then second e-mail saying that the request was not approved? I mean I understand why it happens, but the second one seems really redundant.
2) I noticed that there are newlines in e-mails' subject. Is that intended? 
3) Do we want to send three separate e-mails for each VM if they have been ordered in bulk? I guess it's no big deal with 3 VMs, but imagine 100.

If we find out that something does not work as intended, I will open new bug(s).

Comment 19 Ilanit Stein 2018-05-07 07:43:26 UTC
Moving 	qe_test_coverage to + since this bug was revealed by CFME/RHV VM provision automatic test.

Comment 20 Red Hat Bugzilla 2023-09-14 03:53:36 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.