Bug 1449092

Summary: Host targeted refresh fails when using sdk (v4)
Product: Red Hat CloudForms Management Engine Reporter: Moti Asayag <masayag>
Component: ProvidersAssignee: Moti Asayag <masayag>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: jfrey, jhardy, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rhev
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1458951 (view as bug list) Environment:
Last Closed: 2018-03-06 14:43:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: RHEVM Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1458951    

Description Moti Asayag 2017-05-09 08:28:21 UTC
Description of problem:
When setting manageiq to work with ovirt-engine-sdk [1], and performing a targeted refresh for a host, the action fails.

Version-Release number of selected component (if applicable):
master, based on commit 

How reproducible:
always

Steps to Reproduce:
1. Follow [1] and set manageiq to work with the ovirt-engine-sdk
2. Select a specific host and click on 'Refresh Relationships and Power State'

Actual results:
Action fails and the evm.log contains:
[----] E, [2017-05-09T10:27:57.235798 #18731:1097120] ERROR -- : [NoMethodError]: undefined method `detect' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2017-05-09T10:27:57.236071 #18731:1097120] ERROR -- : /home/masayag/work/manageiq-master/plugins/manageiq-providers-ovirt/app/models/manageiq/providers/redha
t/infra_manager/refresh/parse/strategies/host_inventory.rb:139:in `block in host_inv_to_switch_hashes'
/home/masayag/work/manageiq-master/plugins/manageiq-providers-ovirt/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:135:in
 `each'
/home/masayag/work/manageiq-master/plugins/manageiq-providers-ovirt/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:135:in
 `host_inv_to_switch_hashes'
/home/masayag/work/manageiq-master/plugins/manageiq-providers-ovirt/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:44:in 
`block in host_inv_to_hashes'


Expected results:
Refresh should completed successfully. 

Additional info:
[1] Set ':use_ovirt_engine_sdk' to true in config/settings.yml

The action fails since collecting data for host in v4 doesn't retrieve the entire list of networks. Therefore when trying to find a network which is reported by the host's nic as configured on the host - no network is found.
This leads to the exception above.

Comment 4 Ilanit Stein 2017-11-09 18:22:39 UTC
Verified on 5.9.0.4/RHV-4.1.7

Host's 'Refresh Relationships and Power State' ends up with a successful refresh.