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
@Avital, Would you please add related doc for this?
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.
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.
(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.
@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.
https://github.com/ManageIQ/manageiq/pull/19203