Bug 1851087 - [RFE] Scheduled Retirement - Check for Existing "active" Requests before creating new Request.
Summary: [RFE] Scheduled Retirement - Check for Existing "active" Requests before crea...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.11.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.8
Assignee: Yuri Rudman
QA Contact: Tasos Papaioannou
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-25 15:14 UTC by Tina Fitzgerald
Modified: 2022-07-09 11:43 UTC (History)
4 users (show)

Fixed In Version: 5.11.8.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-30 14:01:07 UTC
Category: Feature
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
simaishi: cfme-5.11.z+


Attachments (Terms of Use)

Description Tina Fitzgerald 2020-06-25 15:14:37 UTC
The retirement process creates an miq_request(types below).

Before we call into retirement, we should check if the miq_request exists and is "active" for a given object.  We should not create the request if the "active" request is found. 

This change is specifically for scheduled retirements.

Retirement can be initiated in multiple ways:
* UI
* Scheduler
* Events/custom buttons/Automate

Retirement/Request types:
* VM's   <----- VMRetireRequest   <--- Zone
* Stacks <--- StackRetirementRequest <--- Zone
* Services <--- ServiceRetireRequest <--- Region

Comment 2 Dave Johnson 2020-06-25 16:03:50 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 6 CFME Bot 2020-08-10 17:50:26 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/2fe223e178308176f6a38028aa01a5841b4d86ab
commit 2fe223e178308176f6a38028aa01a5841b4d86ab
Author:     Yuri Rudman <yrudman>
AuthorDate: Wed Jul 22 19:28:58 2020 +0000
Commit:     Yuri Rudman <yrudman>
CommitDate: Wed Aug  5 17:10:41 2020 +0000

    Changes preventing creation of duplicate retirement request if there is already not approved or not finished retirement request exists.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1851087

 app/models/mixins/retirement_mixin.rb | 12 +-
 app/models/service.rb | 11 +
 app/models/vm.rb | 17 +
 3 files changed, 39 insertions(+), 1 deletion(-)

Comment 7 CFME Bot 2020-08-13 13:50:24 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

https://github.com/ManageIQ/manageiq/commit/c4d9df6c81df405c7937e7986453bdeec98ae172
commit c4d9df6c81df405c7937e7986453bdeec98ae172
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Mon Aug 10 17:49:24 2020 +0000
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Aug 12 21:06:06 2020 +0000

    Merge pull request #20355 from yrudman/use_sql_to_find_active_retirement_requests

    Block attempt to create duplicate retire request

    (cherry picked from commit a2634bc7604568ad19bd1adaa2d42e4354587a2f)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1851087

 app/models/mixins/retirement_mixin.rb | 12 +-
 app/models/orchestration_stack.rb | 13 +
 app/models/service.rb | 13 +
 app/models/vm.rb | 14 +
 spec/factories/miq_request.rb | 1 +
 spec/models/orchestration_stack/retirement_management_spec.rb | 26 +
 spec/models/service/retirement_management_spec.rb | 26 +
 spec/models/vm/retirement_management_spec.rb | 32 +
 8 files changed, 136 insertions(+), 1 deletion(-)

Comment 8 Tasos Papaioannou 2020-09-10 16:18:27 UTC
Verified on 5.11.8.0.

Comment 13 errata-xmlrpc 2020-09-30 14:01:07 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 (Moderate: CloudForms 5.0.8 security, bug fix and enhancement update), 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-2020:4134


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