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.
@Fabien, is this required for 5.9.4 IMS GA or 5.10.0, 1.1?
@Brett, yes it's required for 5.9.4 IMS GA, because cancellation is part of the GA features.
PR is merged. Moving to Post.
Extra PR (bug fix): https://github.com/ManageIQ/manageiq-content/pull/377
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 ?
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.
Extra Automate PR - Fix default cleanup state machine https://github.com/ManageIQ/manageiq-content/pull/382 Associated BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1564257 - https://github.com/ManageIQ/manageiq/pull/17687 - https://github.com/ManageIQ/manageiq-api/pull/421 - https://github.com/ManageIQ/miq_v2v_ui_plugin/pull/517
All PRs merged. Moving to POST.
Identified a bug and provided a fix: https://github.com/ManageIQ/manageiq-content/pull/392 Moving back to ON_DEV.
On 5.10.0.12 I could cancel in progress migration and it did cleanup the RHV disk as well.
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