Bug 1597977

Summary: [v2v] Migration from CSV file fails the second time due to Infrastructure Mapping object ID changes
Product: Red Hat CloudForms Management Engine Reporter: Mor <mkalfon>
Component: UI - OPSAssignee: Brett Thurber <bthurber>
Status: CLOSED NOTABUG QA Contact: Mor <mkalfon>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: akarve, bilwei, bthurber, cpelland, dagur, hkataria, jprause, lavenel, mkalfon, mpovolny, obarenbo, smallamp
Target Milestone: GAKeywords: AutomationBlocker, TestBlocker
Target Release: 5.9.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-25 18:52:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot and log none

Description Mor 2018-07-04 05:20:07 UTC
Created attachment 1456364 [details]
screenshot and log

Description of problem:
When trying to migrate a VM using CSV second time, it fails to start the migration. 

Migration.log:
----] E, [2018-07-04T08:09:31.256725 #8906:3c20300] ERROR -- : Method STDERR: (druby://127.0.0.1:33075) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-ec1e41d2b579/lib/miq_automation_engine/service_models/miq_ae_service_service_template_transformation_plan_task.rb:8:in `block in transformation_destination': undefined method `object_class' for nil:NilClass (NoMethodError)
[----] E, [2018-07-04T08:09:31.260263 #8906:3c20300] ERROR -- : Method STDERR: Did you mean?  object_id
[----] E, [2018-07-04T08:09:31.262154 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-ec1e41d2b579/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:332:in `ar_method'
[----] E, [2018-07-04T08:09:31.264034 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-ec1e41d2b579/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:342:in `ar_method'
[----] E, [2018-07-04T08:09:31.266150 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-ec1e41d2b579/lib/miq_automation_engine/service_models/miq_ae_service_service_template_transformation_plan_task.rb:7:in `transformation_destination'
[----] E, [2018-07-04T08:09:31.268086 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
[----] E, [2018-07-04T08:09:31.270042 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1584:in `perform'
[----] E, [2018-07-04T08:09:31.272008 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:in `block (2 levels) in main_loop'
[----] E, [2018-07-04T08:09:31.273896 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in `loop'
[----] E, [2018-07-04T08:09:31.275741 #8906:3c20300] ERROR -- : Method STDERR:  from (druby://127.0.0.1:33075) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in `block in main_loop'
[----] E, [2018-07-04T08:09:31.277585 #8906:3c20300] ERROR -- : Method STDERR:  from /ManageIQ/Transformation/Common/AssessTransformation:25:in `main'
[----] E, [2018-07-04T08:09:31.279441 #8906:3c20300] ERROR -- : Method STDERR:  from /ManageIQ/Transformation/Common/AssessTransformation:89:in `<main>'
[----] I, [2018-07-04T08:09:31.322526 #8906:83f108]  INFO -- : Q-task_id([service_template_transformation_plan_task_12]) <AEMethod [/ManageIQ/Transformation/Common/AssessTransformation]> Ending
[----] E, [2018-07-04T08:09:31.323586 #8906:83f108] ERROR -- : Q-task_id([service_template_transformation_plan_task_12]) Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]
[----] E, [2018-07-04T08:09:31.325164 #8906:83f108] ERROR -- : Q-task_id([service_template_transformation_plan_task_12]) State=<State2> running  raised exception: <Method exited with rc=Unknown RC: [1]>
[----] W, [2018-07-04T08:09:31.325543 #8906:83f108]  WARN -- : Q-task_id([service_template_transformation_plan_task_12]) Error in State=[State2]

Version-Release number of selected component (if applicable):
5.9.3.4.20180702181921_afd03d

How reproducible:
100%

Steps to Reproduce:
1. Migrate a VM using the list option (to select from discovered VM's).
2. Migrate the same VM using CSV file, with content:
Name
<vm_name>
..
3. Try step 2 again.

Actual results:
Error.

Expected results:
Should start migration.

Additional info:
See screenshot.

Comment 10 Bill Wei 2018-07-10 13:26:30 UTC
The error trace has the word validation. It was not the validation when a plan was created. It happened at the run time from automate when trying to migrate the VM.

The message "[VM10GB_4] NIC Network adapter 1 [VM
> Network]" clearly states the problem. The transformation_mapping stores id to id translation. I guess the reset procedure removes objects in the mapping and adds them back with new ids. The old id-to-id mapping is no longer valid.

Comment 13 Kedar Kulkarni 2018-07-16 21:57:53 UTC
I would like to say that this is not CSV issue, I made sure of testing this again and I could get my migration to work correctly and successfully.

Comment 14 Daniel Gur 2018-07-17 21:39:16 UTC
Mor, Once you come back from PTO please consider if we can close this bug and open another one on documentation team