Bug 1480007

Summary: Provisions via Users in multiple groups in tenants in SSUI result in VMs being provisioned to wrong group/tenant
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ProvisioningAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Leo Khomenko <lkhomenk>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: cpelland, dclarizi, gmccullo, jhardy, myoder, obarenbo, pmcgowan
Target Milestone: GAKeywords: ZStream
Target Release: 5.8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ssui
Fixed In Version: 5.8.2.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1467364 Environment:
Last Closed: 2017-10-24 00:38:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1467364    
Bug Blocks:    

Comment 2 CFME Bot 2017-08-09 22:26:10 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/b5bfa9a483d00d150429a5738a3b27f1a8ef37c3

commit b5bfa9a483d00d150429a5738a3b27f1a8ef37c3
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Aug 2 17:07:40 2017 -0400
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Aug 9 18:22:56 2017 -0400

    Merge pull request #15696 from lfu/service_user_in_groups_1467364
    
    Set user's group to the requester group.
    (cherry picked from commit 1d2c55f08a65a895059415cd829990c5c2db5f74)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480007

 app/models/mixins/miq_request_mixin.rb |  4 +++-
 spec/models/miq_request_spec.rb        | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

Comment 3 CFME Bot 2017-08-10 00:51:17 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/a3bb99ccd92d428c2a7c8218eb09b6e92c731500

commit a3bb99ccd92d428c2a7c8218eb09b6e92c731500
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Aug 9 17:01:12 2017 -0400
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Aug 9 20:46:34 2017 -0400

    Merge pull request #61 from lfu/service_user_in_groups_1467364
    
    Need to pass the user's group in to automate when the provision starts.
    (cherry picked from commit 8de13ba4c7413710e4481cd7484b3675a12bd517)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480007

 lib/miq_automation_engine/engine/miq_ae_engine.rb       |  6 ++++--
 .../engine/miq_ae_engine/miq_ae_object.rb               |  2 +-
 spec/lib/miq_automation_engine/miq_ae_engine_spec.rb    | 17 ++++++++++++++++-
 3 files changed, 21 insertions(+), 4 deletions(-)

Comment 4 CFME Bot 2017-08-10 00:51:22 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/dcf6a95a13601157c6e9b82c65f70b2b7acc58ba

commit dcf6a95a13601157c6e9b82c65f70b2b7acc58ba
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Aug 9 17:02:43 2017 -0400
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Aug 9 20:48:57 2017 -0400

    Merge pull request #15760 from lfu/service_user_in_groups_1467364_2
    
    miq_group_id is required by automate.
    (cherry picked from commit 2fe7cd55211866217cf4c0c1c23687e1372d4008)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480007

 app/models/automation_task.rb       |  2 ++
 spec/models/automation_task_spec.rb | 15 ++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

Comment 6 Peter McGowan 2017-08-29 12:52:34 UTC
Hi

I've applied the CFME 5.8.1.5-5 hotfix build that includes this fix, and now automation requests submitted via the REST API fail with the following errors in evm.log:

[----] E, [2017-08-29T13:51:24.028533 #30902:cb5138] ERROR -- : Q-task_id([automation_task_1000000018320]) MIQ(AutomationTask#execute) [Error: Couldn't find MiqGroup] encountered during Automation Request
[----] E, [2017-08-29T13:51:24.028788 #30902:cb5138] ERROR -- : Q-task_id([automation_task_1000000018320]) [ActiveRecord::RecordNotFound]: Couldn't find MiqGroup  Method:[rescue in execute]

Rolling back to the 5.8.1.5-2 hotfix build that doesn't include this BZ patch fixes these errors, so they seem to be related to this BZ

Also updating https://bugzilla.redhat.com/show_bug.cgi?id=1480286 with the same comment as the two BZs seem to be related.

Comment 9 errata-xmlrpc 2017-10-24 00:38:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:3005