Bug 1650699

Summary: [v2v][rhv] Migration Plan Request gets Denied even if conversion host is configured
Product: Red Hat CloudForms Management Engine Reporter: Kedar Kulkarni <kkulkarn>
Component: V2VAssignee: Brett Thurber <bthurber>
Status: CLOSED NOTABUG QA Contact: Kedar Kulkarni <kkulkarn>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.0CC: fdupont, kkulkarn
Target Milestone: GA   
Target Release: 5.10.0   
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-11-26 15:40:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Bug Depends On: 1643938    
Bug Blocks:    

Description Kedar Kulkarni 2018-11-16 21:46:21 UTC
Description of problem:
Migration Plan Request gets Denied even if conversion host is configured on my appliance via Rails console 

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

How reproducible:
Believe 100% 

Steps to Reproduce:
1.Add VMware and RHV provider
2.Configure RHV conversion host
3.Create infra mapping and migration plan and execute

Actual results:
Request gets Denied.
[----] E, [2018-11-16T16:40:19.266482 #5601:3f10768] ERROR -- : <AEMethod validate_request> The following error occurred during method evaluation:
[----] E, [2018-11-16T16:40:19.267297 #5601:3f10768] ERROR -- : <AEMethod validate_request>   NoMethodError: undefined method `message=' for #<MiqAeMethodService::MiqAeServiceServiceTemplateTransformationPlanRequest:0x0000000015732cc8>
[----] E, [2018-11-16T16:40:19.268085 #5601:3f10768] ERROR -- : <AEMethod validate_request>   (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-4a01657f4f6e/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:234:in `method_missing'
(drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
(drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1584:in `perform'
(drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1668:in `block (2 levels) in main_loop'
(drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1664:in `loop'
(drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1664:in `block in main_loop'
[----] E, [2018-11-16T16:40:19.275183 #5601:3f10768] ERROR -- : Method STDERR: (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-4a01657f4f6e/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:234:in `method_missing': undefined method `message=' for #<MiqAeMethodService::MiqAeServiceServiceTemplateTransformationPlanRequest:0x0000000015732cc8> (NoMethodError)
[----] E, [2018-11-16T16:40:19.275772 #5601:3f10768] ERROR -- : Method STDERR: 	from (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
[----] E, [2018-11-16T16:40:19.276304 #5601:3f10768] ERROR -- : Method STDERR: 	from (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1584:in `perform'
[----] E, [2018-11-16T16:40:19.276766 #5601:3f10768] ERROR -- : Method STDERR: 	from (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1668:in `block (2 levels) in main_loop'
[----] E, [2018-11-16T16:40:19.277293 #5601:3f10768] ERROR -- : Method STDERR: 	from (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1664:in `loop'
[----] E, [2018-11-16T16:40:19.277739 #5601:3f10768] ERROR -- : Method STDERR: 	from (drbunix:///tmp/automation_engine20181116-5601-upj7q1) /usr/share/ruby/drb/drb.rb:1664:in `block in main_loop'
[----] E, [2018-11-16T16:40:19.278088 #5601:3f10768] ERROR -- : Method STDERR: 	from /ManageIQ/Transformation/StateMachines/TransformationPlanRequestApproval/validate_request:5:in `<main>'
[----] I, [2018-11-16T16:40:19.301437 #5601:7f8f78]  INFO -- : <AEMethod [/ManageIQ/Transformation/StateMachines/TransformationPlanRequestApproval/validate_request]> Ending
[----] E, [2018-11-16T16:40:19.301820 #5601:7f8f78] ERROR -- : State=<ValidateRequest> running on_entry raised exception: <Method exited with rc=Unknown RC: [1]>
[----] W, [2018-11-16T16:40:19.301929 #5601:7f8f78]  WARN -- : Error in State=[ValidateRequest]



Expected results:
Request should not be denied

Additional info:
I can provide appliance that can reproduce this issue.

Comment 2 Fabien Dupont 2018-11-18 17:02:04 UTC
Can I get access to the appliance ? Please always add this information as it accelerates debugging. Thanks

Comment 3 Kedar Kulkarni 2018-11-19 01:39:45 UTC
Hey Fabien, 10.16.5.104 and 10.16.5.105 have 1 migration plan each stuck in slightly different states. Will expire in 7 days.

Comment 4 Fabien Dupont 2018-11-19 16:04:38 UTC
The conversion host was not correctly setup: 3 records in the DB for only one conversion host. This should not happen in real life because we'll have API to CRUD the conversion hosts. I have removed the extra records.

Would you mind recreating the migration plan and try it again ?


# vmdb
# rails c
irb> ServiceTemplateTransformationPlanRequest.all.each { |r| r.destroy }
irb> ServiceTemplateTransformationPlan.all.each { |p| p.destroy }

Comment 5 Kedar Kulkarni 2018-11-19 18:39:54 UTC
Thanks Fabien. Does it mean I cannot set more than one conversion host? Or there were duplicate records for one conversion host?

Comment 6 Fabien Dupont 2018-11-20 08:03:26 UTC
All 3 records where pointing to the same instance, so the backend code was confused and fails allocating a host. That's one of the problems when using rails console: no check is done. The API will check that for us.

Comment 7 Fabien Dupont 2018-11-26 13:48:18 UTC
Kedar, do you still encounter this issue ?

Comment 8 Kedar Kulkarni 2018-11-26 15:40:13 UTC
I believe this was due to Rails command being run multiple times, cannot reproduce it if I follow the steps.We will need to revisit this once we move away from rails command usage for conversion appliance config. Closing for now.