Bug 1744197 - [v2v] Ordering a migration plan, that contains MIGRATED VM/s, fails with an unclear error message.
Summary: [v2v] Ordering a migration plan, that contains MIGRATED VM/s, fails with an u...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: V2V
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.12.0
Assignee: Fabien Dupont
QA Contact: Md Nadeem
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1768520
TreeView+ depends on / blocked
 
Reported: 2019-08-21 13:52 UTC by Ilanit Stein
Modified: 2020-04-27 10:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1768520 (view as bug list)
Environment:
Last Closed: 2020-03-25 18:02:25 UTC
Category: Bug
Cloudforms Team: V2V
Target Upstream Version:
Embargoed:
mfeifer: mirror+


Attachments (Terms of Use)
error screenshot (100.45 KB, image/png)
2019-08-21 13:52 UTC, Ilanit Stein
no flags Details

Description Ilanit Stein 2019-08-21 13:52:01 UTC
Created attachment 1606548 [details]
error screenshot

Description of problem:
In case of ordering a migration plan that contains a VM, that was already migrated successfully to RHV, the order will fail on error, displayed in UI:
ERROR -- : MIQ(Api::ServiceTemplatesController.api_error) Api::BadRequestError: Service Template id:9 name:'test' cannot be ordered.

Same error also appear in api.log.

The actual reason for the failure is that Migrated VMs are tagged as "Migrated" (Recent CFME / v2v addition),
and this marking, prevents from migrating them again.

Can we have the above error more clear, to have it indicate the real cause of the failure?
Maybe something like:
"Migration plan cannot be ordered since it contains migrated VMs.
either remove the migrated VMs from the plan, or untag the VMs"

Version-Release number of selected component (if applicable):
CFME-5.11.0.19/RHV-4.3.5

Comment 2 Ilanit Stein 2019-08-21 14:06:48 UTC
@Avital,

Would you please add related doc for this?

Comment 3 Ilanit Stein 2019-08-21 15:17:44 UTC
Also I just ordered successfully a migration plan, that contained one VM that was tagged with "Migrated" tag.
All other VMs were not tagged with "Migrated"

I would expect the migration order fail, just the same as the migration plan order failed, when it contains a single VM, marked as tagged, as mentioned in this bug description.

Comment 4 Fabien Dupont 2019-08-21 19:14:25 UTC
No. It only fails when all the VMs are tagged as migrated. VM tagging is the last step of the migration workflow.
We did that to avoid that a completed plan is started again. And a completed plan is a plan where all VM are tagged as migrated.
So, it's normal that :
  - A plan with multiple VMs, but only one tagged as migrated, can be ordered. It's the retry mechanism.
  - A plan with only one VM, the VM being tagged as migrated, cannot be ordered. That prevents starting a completed plan.

Comment 6 Avital Pinnick 2019-08-22 09:22:57 UTC
(In reply to Ilanit Stein from comment #0)

> Can we have the above error more clear, to have it indicate the real cause
> of the failure?
> Maybe something like:
> "Migration plan cannot be ordered since it contains migrated VMs.
> either remove the migrated VMs from the plan, or untag the VMs"

Ilanit,

Current docs say that in this scenario (migrating previously migrated VMs), the procedure is to add VMs to the migration with a CSV file.

Do you want me to remove references to adding migrated VMs with CSV file and add a step to untag VMs with the 'migrated' tag in CloudForms? 

This does seem to be an easier solution than creating a CSV file and I'm not sure why we did not do so in the first place.

Comment 7 Ilanit Stein 2019-08-25 07:57:08 UTC
@Fabien,
Thanks for explaining the logic behind this.

I think an error message like:
"Migration plan cannot be ordered, since it contains previously migrated VMs.",
would be sufficient, to resolve this bug.

@Avital,
We can add in the documentation that, 
If still you want to migrate, previously migrated VMs, the "Migrated" tag should be removed first. 

Just to clarify: 
In UI, it is not possible to order a migration plan, that all it's VMs were migrated successfully.
It is also not possible to create a *new* migration plan with VMs, that were already migrated successfully, and they exist in an existing migration plan.
However, if the existing migration plan, is removed, it is possible to create a new migration plan, with previously migrated VMs.
And this is exactly the flow I did, when I encountered the error, mentioned in the bug description.

Regarding using a CSV file, for migrating previously migrated VMs - 
I would suspect that migration plan ordering will fail the same (as mentioned in the bug description).
Having the VMs list sourced from a CSV file, should not matter.

Comment 8 Fabien Dupont 2019-08-26 21:21:19 UTC
https://github.com/ManageIQ/manageiq/pull/19203


Note You need to log in before you can comment on or make changes to this bug.