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
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.
https://github.com/ManageIQ/manageiq/pull/20334
https://github.com/ManageIQ/manageiq/pull/20355
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(-)
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(-)
Verified on 5.11.8.0.
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