Bug 1788505

Summary: [v2v] Preflight check doesn't report error as expected and the migration plan cannot be canceled
Product: Red Hat CloudForms Management Engine Reporter: Maayan Hadasi <mguetta>
Component: V2VAssignee: Fabien Dupont <fdupont>
Status: CLOSED DUPLICATE QA Contact: Maayan Hadasi <mguetta>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.4CC: bthurber, dagur, dmetzger, istein
Target Milestone: GA   
Target Release: 5.11.z   
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: 2020-04-10 13:35:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Attachments:
Description Flags
evm.log none

Description Maayan Hadasi 2020-01-07 11:29:00 UTC
Created attachment 1650361 [details]
evm.log

Description of problem:
Using ManageIQ (CFME upstream), when migrating VM (VMware to RHV) who is expected to fail at preflight check - the migration plan seems to be stuck in the preflight stage and cannot be canceled


Version-Release number of selected component (if applicable):
ManageIQ: master.20191217224046_ebd4ebf


How reproducible:
100%


Steps to Reproduce:
1. Create a infrastructure mapping with one cluster mapping
2. Create a migration plan with the previously created infrastructure mapping
3. Delete the cluster mapping item from Rails console:
   irb> mapping = TransformationMapping.find_by(:name => 'My Mapping')
   irb> mapping.transformation_mapping_items.select { |i| i.source_type == 'EmsCluster' }.each { |i| i.destroy }

4. Start the migration plan


Actual results:
The preflight check isn't reported the expected error status (see below) - task.status is OK.
It seems that the migration plan is stuck on preflight stage - "Waiting for an available conversion host..." is displayed in UI
And the migration plan cannot be canceled - pressing on 'Cancel Migration' button actually doesn't cancel it and the button becomes disabled after one try


Expected results:
The VM migration should fail right away, without waiting for a conversion host. This can be verified in Rails console:

irb> vm = Vm.find_by(:name => 'my_vm', :vendor => 'vmware')
irb> task = ServiceTemplateTransformationPlanTask.where(:source => vm).last
irb> task.status
=> "Error"
irb> task.conversion_host
=> nil


Additional info:
In log/evm.log, you can see the following error message:

[----] E, [2020-01-07T04:48:43.630262 #10908:8c260c] ERROR -- : Q-task_id([job_dispatcher]) /var/www/miq/vmdb/app/models/service_template_transformation_plan_task.rb:82:in `destination_cluster'


Attachment: evm.log

Comment 2 Maayan Hadasi 2020-01-08 07:00:34 UTC
*** Bug 1788523 has been marked as a duplicate of this bug. ***

Comment 3 Ilanit Stein 2020-01-08 07:22:17 UTC
If possible, as part of this bug, please do not display we are at "wait for conversion host.." state, while we have't reached that yet. This is misleading. thanks.

Comment 4 Fabien Dupont 2020-01-08 09:12:51 UTC
Preflight check is part of "Waiting for conversion host" and I don't think I will dissociate them...

Comment 5 Fabien Dupont 2020-04-10 13:35:50 UTC

*** This bug has been marked as a duplicate of bug 1809035 ***