Bug 1592430

Summary: RHV provider target refresh fail on "undefined method `cluster'", right after VM removal
Product: Red Hat CloudForms Management Engine Reporter: Ilanit Stein <istein>
Component: ProvidersAssignee: Martin Perina <mperina>
Status: CLOSED CURRENTRELEASE QA Contact: Angelina Vasileva <anikifor>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gblomqui, jfrey, jhardy, jprause, mgoldboi, mperina, obarenbo, simaishi
Target Milestone: GAKeywords: Automation, TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rhev
Fixed In Version: 5.10.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1594839 (view as bug list) Environment:
Last Closed: 2019-02-11 14:06:17 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: 1594839    
Attachments:
Description Flags
evm.log
none
rhevm.log none

Description Ilanit Stein 2018-06-18 14:02:59 UTC
Description of problem:
CFME connected to a RHV provider.
VM removal on RHV side is followed by a refresh failure:

In RHV provider details page, "last Refresh" field show:
"Error - 4 Minutes Ago
undefined method `cluster' for nil:NilClass"

Version-Release number of selected component (if applicable):
CFME-5.9.3.1
RHV-4.2.3

Expected results:
RHV VM removal should not cause RHV refresh failure.

Additional info:
* Running "Refresh Relationships and power states" for the RHV provider, after the refresh failure ends up with a successful refresh.
* This is not happening on CFME-5.9.3.0,
therefore might be that bug is related to Graph refresh, that was switched to ON in CFME-5.9.3.1

Comment 2 Ilanit Stein 2018-06-18 14:05:14 UTC
Created attachment 1452654 [details]
evm.log

Comment 3 Ilanit Stein 2018-06-18 14:28:35 UTC
Created attachment 1452657 [details]
rhevm.log

Comment 4 Ilanit Stein 2018-06-19 15:23:56 UTC
This bug is indeed related to having RHV Graph refresh ON.

When moving RHV Graph refresh to OFF,
VM removal on RHV side, is not followed by error target refresh error.

Comment 7 CFME Bot 2018-06-24 11:53:42 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/31d481adb954c50c2efa1219873af9b5be6da4ac
commit 31d481adb954c50c2efa1219873af9b5be6da4ac
Author:     Boris Odnopozov <bodnopoz>
AuthorDate: Thu Jun 21 05:41:36 2018 -0400
Commit:     Boris Odnopozov <bodnopoz>
CommitDate: Thu Jun 21 05:41:36 2018 -0400

    Fix vm targeted refresh on removal

    Targeted graph refresh on deleted vm would fail.

    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1592430

 app/models/manageiq/providers/redhat/inventory/collector/target_collection.rb | 2 +-
 app/models/manageiq/providers/redhat/inventory/parser/infra_manager.rb | 2 +-
 spec/models/manageiq/providers/redhat/infra_manager/refresh/refresher_graph_target_vm_spec.rb | 15 +
 spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/ovirt_sdk_refresh_graph_target_vm_removal.yml | 4557 +
 4 files changed, 4574 insertions(+), 2 deletions(-)

Comment 8 Moran Goldboim 2018-06-25 07:33:24 UTC
retargeting to 5.9.3, since graph refresh is on by default in this version.

Comment 9 Ilanit Stein 2018-06-25 11:24:49 UTC
Verified on CFME-5.9.3.2 + Fix for bug 1593202 + Fix attached to this bug / 
RHV-4.2.3.5.

Comment 11 Ilanit Stein 2018-09-17 11:01:40 UTC
Verified on CFME-5.10.0.15 (Graph refresh is ON, by default)/RHV-4.2.3.

Removal of a VM from RHV provider (done on RHV side), is followed by a successful target refresh.