Bug 1610533

Summary: [RFE] CFME 5.9.4 - ability to cancel an in-progress migration
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: UI - OPSAssignee: Marco Berube <mberube>
Status: CLOSED CURRENTRELEASE QA Contact: Kedar Kulkarni <kkulkarn>
Severity: low Docs Contact:
Priority: high    
Version: 5.9.0CC: bthurber, cpelland, fdupont, gmccullo, hkataria, jhardy, jprause, kkulkarn, lavenel, mberube, mpovolny, obarenbo, smallamp
Target Milestone: GAKeywords: FutureFeature, RFE, ZStream
Target Release: 5.9.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: 5.9.4.4 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1564257 Environment:
Last Closed: 2018-09-05 12:57:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1564257, 1599997, 1614864    
Bug Blocks: 1608758    
Attachments:
Description Flags
ScreenVideoRecording none

Comment 2 CFME Bot 2018-07-31 21:21:16 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/e22387a84958be350f76052817be02e89a7ffab5
commit e22387a84958be350f76052817be02e89a7ffab5
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Jul 11 15:59:59 2018 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Jul 11 15:59:59 2018 -0400

    Merge pull request #17687 from bzwei/miq_request_cancel

    Support cancellation for miq_request and miq_request_task
    (cherry picked from commit d676ff58e41e587270f58efefaf4a01f173f6206)

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

 app/models/miq_request.rb | 8 +
 app/models/miq_request_task.rb | 8 +
 app/models/service_template_transformation_plan_request.rb | 10 +
 app/models/service_template_transformation_plan_task.rb | 9 +
 4 files changed, 35 insertions(+)

Comment 3 CFME Bot 2018-07-31 21:28:33 UTC
New commit detected on ManageIQ/manageiq-api/gaprindashvili:

https://github.com/ManageIQ/manageiq-api/commit/b7047744b21596fafe4cbfdc1064cad1fd8ba76c
commit b7047744b21596fafe4cbfdc1064cad1fd8ba76c
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Mon Jul 30 18:02:12 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Mon Jul 30 18:02:12 2018 -0400

    Merge pull request #421 from bdunne/request_cancel

    Request cancel
    (cherry picked from commit 62de390490c8bc333f27feedfc58455ced1e7483)

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

 app/controllers/api/automation_requests_controller.rb | 1 +
 app/controllers/api/mixins/resource_cancel.rb | 14 +
 app/controllers/api/provision_requests_controller.rb | 1 +
 app/controllers/api/request_tasks_controller.rb | 1 +
 app/controllers/api/requests_controller.rb | 1 +
 app/controllers/api/service_requests_controller.rb | 1 +
 app/controllers/api/subcollections/request_tasks.rb | 7 +
 app/controllers/api/subcollections/service_requests.rb | 7 +
 config/api.yml | 31 +
 spec/requests/automation_requests_spec.rb | 12 +
 spec/requests/provision_requests_spec.rb | 12 +
 spec/requests/request_tasks_spec.rb | 7 +
 spec/requests/requests_spec.rb | 12 +
 spec/requests/service_orders_spec.rb | 6 +
 spec/requests/service_requests_spec.rb | 12 +
 spec/requests/service_templates_spec.rb | 6 +
 spec/support/api/helpers.rb | 8 +-
 spec/support/factory_overrides.rb | 23 +
 spec/support/shared_examples/resource_cancel.rb | 40 +
 spec/support/shared_examples/sub_resource_cancel.rb | 38 +
 20 files changed, 239 insertions(+), 1 deletion(-)

Comment 5 Kedar Kulkarni 2018-08-08 17:25:25 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1599997 blocks this, as the cancellation does not guarantee of cleaning the Target Datastore or kill virt-v2v at the moment.

Comment 6 Kedar Kulkarni 2018-08-09 17:07:07 UTC
Pushing back to Assigned. As in 5.9.4.3 I am not able to cancel the migration successfully. CloudForms UI shows notification as "Migration Cancelled Successfully" , although, the timer and progress bar does not stop and migration is continued. On RHV I can also see disk size increasing and being transferred actively.

Comment 7 Kedar Kulkarni 2018-08-09 17:08:18 UTC
Created attachment 1474778 [details]
ScreenVideoRecording

Comment 9 Fabien Dupont 2018-08-10 14:55:01 UTC
Confirmed by Bill Wei that the options hash is cached and that parallel writes may create a race condition. First suggestion was to reload the object before using set_option in automate, but Bill considers that set_option should be fixed to prevent race condition.

The potential impact is high, so it has to be carefully weighed.

Associated BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1614864

Comment 10 John Prause 2018-08-13 12:40:31 UTC
Marco: Tomorrow (Aug 14) is the final 5.9.4 dev complete. Will this issue be resolved by then.

Comment 11 Brett Thurber 2018-08-15 00:30:15 UTC
(In reply to John Prause from comment #10)
> Marco: Tomorrow (Aug 14) is the final 5.9.4 dev complete. Will this issue be
> resolved by then.

PR is merged and this is ready for backport.

Comment 12 Kedar Kulkarni 2018-08-17 18:51:36 UTC
On 5.9.4.4 I was able to cancel the migration successfully. Although it showed up as cancelled in CloudForms quickly, in the RHV Disks, it kept on migrating for some time before it was killed. It is not instantaneous.