Bug 1305535

Summary: unable to manage rhevm 3.6.2
Product: Red Hat CloudForms Management Engine Reporter: Dave Johnson <dajohnso>
Component: ProvidersAssignee: Oved Ourfali <oourfali>
Status: CLOSED ERRATA QA Contact: Matouš Mojžíš <mmojzis>
Severity: high Docs Contact:
Priority: high    
Version: 5.5.0CC: gblomqui, jfrey, jhardy, jkrocil, juan.hernandez, masayag, nicolas, obarenbo
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rhev
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 15:36:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1301992    
Bug Blocks:    

Description Dave Johnson 2016-02-08 14:28:54 UTC
Description of problem:
================================
Attempting to manage a RHEV 3.6.2 environment, I get the following error in evm.log which kills the initial ems_refresh thereby discovering nothing.

We tested a few weeks back and this was originally working, not sure the version though.  Install date was ~Dec15 and testing on it looked good so maybe 3.6.1?


[----] E, [2016-02-07T23:30:53.953117 #24481:62b998] ERROR -- : /opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/vm.rb:277:in `parse_xml'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/base.rb:7:in `create_from_xml'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/service.rb:22:in `xml_to_object'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/service.rb:120:in `block in standard_collection'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:187:in `block in each'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:186:in `upto'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:186:in `each'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/service.rb:120:in `collect'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/service.rb:120:in `standard_collection'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/inventory.rb:100:in `standard_collection'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/inventory.rb:72:in `vms'
/opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/inventory.rb:143:in `block in collect_primary_items'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:296:in `call'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:296:in `call_with_index'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:135:in `block (2 levels) in work_in_threads'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:125:in `loop'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:125:in `block in work_in_threads'
/opt/rh/cfme-gemset/gems/parallel-0.5.21/lib/parallel.rb:14:in `block (2 levels) in in_threads'
[----] E, [2016-02-07T23:30:53.953175 #24481:62b998] ERROR -- : MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresher#refresh) EMS: [brno-rhev], id: [23000000000001] Unable to perform refresh for the following targets:


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


How reproducible:
==================
100%


Steps to Reproduce:
1.   Add rhevm 3.6.2 env to CFME
2.
3.

Additional info:

Comment 3 Greg Blomquist 2016-02-08 16:26:13 UTC
Oved, can your team take a look at this?  I wonder if something changed in the XML format recently from the rhevm API.

Comment 4 Juan Hernández 2016-02-08 19:45:56 UTC
This is caused by the bug 1301992, which will be fixed in 3.6.3. As a workaround you can apply the following change to the vm.rb file:

-- /opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/vm.rb 2016-01-26 15:32:22.436038845 +0100
+++ /opt/rh/cfme-gemset/gems/ovirt-0.7.1/lib/ovirt/vm.rb.new    2016-01-26 15:32:15.548038845 +0100
@@ -274,6 +274,8 @@
       parse_first_node(node, :placement_policy, hash,
                        :node => [:affinity])

+      hash[:placement_policy] = {} if hash[:placement_policy].nil?
+
       parse_first_node_with_hash(node, 'placement_policy/host', hash[:placement_policy][:host] = {},
                                  :attribute => [:id])

Se also the following upstream issue:

  [Capablanca] - Refresh relationships fails for oVirt (RHEV) provider
  https://github.com/ManageIQ/manageiq/issues/5741

Comment 5 Oved Ourfali 2016-02-10 12:48:00 UTC
Please test with latest 3.6.3 build of RHEV.

Comment 6 Matouš Mojžíš 2016-04-27 15:36:28 UTC
Verified in 5.6.0.4-beta2.3.20160421172650_719e256 + RHEVM 3.6.5.
I was able to add rhevm 3.6.3 to providers and refresh it to get data about hosts/vms etc..

Comment 8 errata-xmlrpc 2016-06-29 15:36:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348