Bug 1951660

Summary: Enable migration plan duplication in web console
Product: Migration Toolkit for Virtualization Reporter: Ilanit Stein <istein>
Component: GeneralAssignee: vconzola
Status: CLOSED ERRATA QA Contact: kpunwatk
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 2.0.0CC: apinnick, fdupont, istein, miguel, mturley, vconzola
Target Milestone: ---   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-09 19:20:45 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:

Description Ilanit Stein 2021-04-20 16:46:10 UTC
Description of problem:
A migration plan can be edited only if it was not started yet.

In case the plan was cancelled, 
or after a migration plan fails the plan is no longer editable.

Use cases for example:
1. If the failure is caused by the network/storage mapping,
users cannot edit the plan and change the mapping. 

2. If a plan was cancelled since users didn't set the plan correctly,
it is not possible. Need to delete current plan and create a new one.

Can edit option be added in cases of plan failed/cancelled?

Version-Release number of selected component (if applicable):
MTV-2.0.0-18

Comment 1 Mike Turley 2021-04-20 22:02:59 UTC
This was an intentional decision based on limitations of the plan CR and logic based on it. We need to evaluate if it is safe to edit plans after they already have migration data associated, and what parts can and cannot be edited, etc.

I would consider this an RFE, and in fact one of the use cases for partially editing a plan after is has run is captured in https://github.com/konveyor/forklift-ui/issues/438. Changing the mappings also sounds like something that could be non-destructive (and maybe it would be nice to be able to view the mapping used by a plan after it can't be edited, since plans in the list don't show their mapping data unless you edit them and look at those wizard steps. It also might be feasible to have a "clone" option, to create a copy of a plan that can then be edited before it is started.

Needs design and review of dev needs. cc @vconzola

Comment 2 vconzola 2021-04-23 14:33:56 UTC
After meeting with Jeff, Miguel, and Mike we propose adding a "plan clone" feature first because that will be easier to implement for 2.1. If a user wants to edit a plan that has already been started and canceled, or has completed and failed, they can clone it and create a new plan which can be edited. The user will have the option of whether to include already migrated VMs in the clone (default is no). If the user chooses to include already migrated VMs in the clone the UI will alert them that they must be manually removed from the target cluster before migration or they will fail.

Comment 3 Mike Turley 2021-05-06 15:07:32 UTC
@miguel Vince wanted me to ask you if we have real requirements here and whether we should keep this targeted for 2.1.0.

Comment 4 Miguel Perez Colino 2021-06-07 09:02:29 UTC
Hey @mturley
The idea behind cloning a plan was to keep all the logs and events related to it so, in case some forensic intervention is needed no data will be lost.
I've been reviewing how the data from logs (containers that already run) and plans (CRD for migration) are stored and we can still keep those even if the plan is edited. 
For edited plans, the cancel feature for a VM should be ephemeral ... this means, that if you cancel a VM while a plan is running and then you edit the plan again, that cancelled VM will appear in the list of selected VMs available to be migrated.  

I still haven't consolidated the requirements into one piece of documentation. Hope this helps.

Comment 5 Fabien Dupont 2021-10-11 10:23:28 UTC
Please verify with mtv-operator-bundle-2.2.0-41 / iib:122011, or later.

Comment 6 Fabien Dupont 2021-10-11 13:45:03 UTC
I've updated the title of this BZ in order to reflect our decision to only allow plan duplication in MTV 2.2.0.
I've created https://bugzilla.redhat.com/show_bug.cgi?id=2012795 to allow editing plans for which no VM has been successfully migrated.

Comment 7 kpunwatk 2021-10-29 08:00:24 UTC
Verified on MTV-2.2.0-63/CNV-2.9.0-249
Duplicate Feature allows you to create a copy of the plan where we can edit failed/cancelled Plan (Vms, mappings, hooks, etc.).
Also allow you duplicate a plans if they are in running, succeeded, critical status which can be edited with all the migration data intact.

Comment 10 errata-xmlrpc 2021-12-09 19:20:45 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 (MTV 2.2.0 Images), 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/RHEA-2021:5066