Description of problem:
When have migration plans that already finished successfully and the migrated VM was deleted in the source system, the new plan failed to run.
The plan status is: "Running - preparing for migration"
and in the progress status is "Not Started".
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a migration plan, run it (should finish successfully)
2. Delete the migrated VM from the source system, but not delete his migration plan
3. Create another migration plan and try to run it
a migration plan isn't running
a migration plan should be running
What are the VMs in the second plan? The same as the first plan?
I fail to understand what you are trying to do here.
The second plan use diff VMs
I got a similar behavior when I created a plan from CLI, and run it from CLI, and then I deleted the plan from UI.
The migration CR was not deleted. and when I tried to run the plan again, it didn't start as described here in the bug.
Maybe in your flow the previous migration CR was not deleted?
There is a bug that when a plan CR is deleted in CLI the migration CR should be deleted too.
But I think that even if we run a plan, though it's previous CR still exist, it should not cause the plan to be at a "non starting" state, but rather fail.
Would it be possible to have access to an environment where it's happening? I still don't understand the exact flow.
@email@example.com, could you please help troubleshooting this?
The issue here is a specific edge case in the scheduler when it encounters a completed Plan, but one or more of the source VMs on that Plan have been removed from the inventory. VMs on completed Plans can't affect the schedule because they're not running, but they shouldn't be considered by the scheduler at all. The scheduler needs to A) disregard completed Plans, and B) not fail if a VM can't be found in the inventory. This is unrelated to any issues regarding Migration CRs being left behind after a plan is deleted.
The fix is in build 2.0.0-10 / iib:73160.
Verified on MTV_2.0.0-12 / iib:73572