Bug 1599997

Summary: [RFE] Update WeightedUpdateStatus to handle task cancellation and cleanup
Product: Red Hat CloudForms Management Engine Reporter: Fabien Dupont <fdupont>
Component: AutomateAssignee: Fabien Dupont <fdupont>
Status: CLOSED ERRATA QA Contact: Kedar Kulkarni <kkulkarn>
Severity: low Docs Contact:
Priority: high    
Version: 5.9.0CC: bthurber, cpelland, fdupont, kkulkarn, mkanoor, obarenbo, simaishi, smallamp, tfitzger
Target Milestone: GAKeywords: FutureFeature
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1608758 (view as bug list) Environment:
Last Closed: 2019-02-07 23:03:14 UTC Type: Bug
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: 1564257    
Bug Blocks: 1564236, 1608758, 1610533    

Description Fabien Dupont 2018-07-11 07:40:00 UTC
Description of problem:
We need to implement task cancellation and cleanup. @bzwei has started implementing task cancellation on the backend: https://github.com/ManageIQ/manageiq/pull/17687/files. It adds an entry in task options hash called cancel_requested with value true. So we check if this entry exists and if yes we trigger the cleanup state machine and raise to abort the current state machine.

The method should trigger the cleanup state machine when the migration is failed, i.e. the state exits on_error. The cleanup state machine is the same for failure and cancellation, as cancellation can be seen as a manual failure.

Comment 2 Brett Thurber 2018-07-17 05:02:14 UTC
@Fabien, is this required for 5.9.4 IMS GA or 5.10.0, 1.1?

Comment 3 Fabien Dupont 2018-07-20 11:05:54 UTC
@Brett, yes it's required for 5.9.4 IMS GA, because cancellation is part of the GA features.

Comment 4 Brett Thurber 2018-07-23 15:04:48 UTC
PR is merged.  Moving to Post.

Comment 6 Fabien Dupont 2018-07-27 21:51:30 UTC
Extra PR (bug fix):
https://github.com/ManageIQ/manageiq-content/pull/377

Comment 7 Fabien Dupont 2018-07-28 21:51:11 UTC
Extra PR - Add default cleanup state machine for VM transformation:
https://github.com/ManageIQ/manageiq-content/pull/378

Maybe this BZ should be renamed to reflect all the associated changes. It doesn't only update a method to trigger cleanup. It also adds the default cleanup state machine. @simaishi, what do you think ?

Comment 8 Kedar Kulkarni 2018-07-30 18:14:35 UTC
In 5.10.0.6, there could be backend changes in automate, I cannot validate those unless I have some UI. Please bring this back on_qa for appropriate build with UI changes as well.

Comment 10 Fabien Dupont 2018-08-02 07:39:03 UTC
All PRs merged. Moving to POST.

Comment 11 Fabien Dupont 2018-08-03 09:41:57 UTC
Identified a bug and provided a fix:
https://github.com/ManageIQ/manageiq-content/pull/392

Moving back to ON_DEV.

Comment 12 Kedar Kulkarni 2018-08-23 20:27:35 UTC
On 5.10.0.12 I could cancel in progress migration and it did cleanup the RHV disk as well.

Comment 13 errata-xmlrpc 2019-02-07 23:03:14 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-2019:0212