Bug 1170813

Summary: scvmm EmsRefresh.save_hosts_inventory error ActiveRecord::StatementInvalid
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: InsightAssignee: Bronagh Sorota <bsorota>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.3.0CC: dclarizi, gblomqui, mfalesni, mfeifer
Target Milestone: GA   
Target Release: 5.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.4.0.0.11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1173616 1178990 (view as bug list) Environment:
Last Closed: 2015-06-16 12:45:48 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:    
Bug Blocks: 1173616, 1178990    

Comment 3 Greg Blomquist 2014-12-05 04:21:01 UTC
The problem here is with the EmsRefresh::Parsers::Scvmm#identify_primary_ip method.

If the method is unable to find any IP addresses that are ":UsedForManagement", then it returns the entire array of all IP data for the host.

There may be a way to fix this at the customer site by simply making sure all hosts have an IP that is :UsedForManagement.  Unfortunately, I have no idea what that actually means in SCVMM.

The actual fix is to change the identify_primary_ip method to only return IP information if any is found.  Otherwise, return nil.  We just have to make sure that assigning no IP address to a host is OK.  I'm not positive it is, though.

Comment 5 Greg Blomquist 2014-12-11 15:22:47 UTC
The problem appears to be that when scvmm hosts do not have a Management IP selected.

The best we can probably do as a code fix is to add better logging for when we skip hosts and indicate that the host requires one of the IP addresses enabled as the Management IP.

This should also be documented as well, that CFME requires SCVMM Hosts to have a Management IP enabled.

Comment 6 CFME Bot 2015-01-17 02:31:14 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ae1641809e3ead7525c8f4e39ff8380021234255

commit ae1641809e3ead7525c8f4e39ff8380021234255
Author:     Bronagh Sorota <bsorota>
AuthorDate: Wed Oct 15 13:58:54 2014 -0400
Commit:     Bronagh Sorota <bsorota>
CommitDate: Fri Dec 19 13:37:04 2014 -0500

    Deals with NICs without any IPs or no mgmt IP
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1170813

 vmdb/app/models/ems_refresh/parsers/scvmm.rb | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comment 7 Milan Falešník 2015-03-05 15:22:07 UTC
Verified in 5.4.0.0.10, when I removed the management option in CVMM from the adapter, the host was retrieved without error. It had no IP address and when I enabled the management option back, it then retrieved the IP address.

Comment 10 errata-xmlrpc 2015-06-16 12:45:48 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://rhn.redhat.com/errata/RHBA-2015-1100.html