Bug 1546792

Summary: Graph refresh does not fetch custom attributes
Product: Red Hat CloudForms Management Engine Reporter: Boriso <bodnopoz>
Component: ProvidersAssignee: Boriso <bodnopoz>
Status: CLOSED CURRENTRELEASE QA Contact: Angelina Vasileva <anikifor>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: bodnopoz, gblomqui, istein, jfrey, jhardy, mperina, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1559624 (view as bug list) Environment:
Last Closed: 2019-02-11 14:02:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: RHEVM Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1532255, 1559624    

Description Boriso 2018-02-19 15:52:02 UTC
Description of problem:
When using graph refresh custom attributes for vms are not fetched

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

How reproducible:
100%

Steps to Reproduce:
1. Enable graph refresh (in settings.yml set :inventory_object_refresh to true)

2. On provider edit a vm so that it has a custom property 
2.1. edit vm, 
2.2. show advanced options
2.3. go to Custom Properties
2.4. add a property, fir example set "sap_agent" to false)

3. Refresh the provider.

Actual results:

The Vm does not have the custom_attribute.

Expected results:
The Vm does have the custom attribute.

Additional info:

I check the custom_sttributes from rails console:
Vm.where(name: <<<<name of the vm>>>>).first.custom_attributes.count should be greater than zero.

When graph refresh is disabled it works properly.

Comment 2 Dave Johnson 2018-02-19 16:04:43 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 4 CFME Bot 2018-03-01 10:54:22 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:
https://github.com/ManageIQ/manageiq-providers-ovirt/commit/bcb84dab6cba90d91f2487e0f8fb5841649f0962

commit bcb84dab6cba90d91f2487e0f8fb5841649f0962
Author:     Boris Odnopozov <bodnopoz>
AuthorDate: Wed Feb 28 17:48:06 2018 +0200
Commit:     Boris Odnopozov <bodnopoz>
CommitDate: Wed Feb 28 17:54:11 2018 +0200

    Fix graph refresh fetching custom attributes
    
    Graph refresh fixed to fetch the custom attributes for both full and targeted refresh.
    
    Fix: https://bugzilla.redhat.com/show_bug.cgi?id=1546792

 .../manageiq/providers/redhat/infra_manager.rb     |    1 +
 .../redhat/inventory/parser/infra_manager.rb       |   11 +-
 .../redhat/inventory/persister/infra_manager.rb    |    2 +-
 .../inventory/persister/target_collection.rb       |    5 +-
 .../inventory_collection_default/infra_manager.rb  |   17 +
 .../refresh/refresher_4_custom_attributes_spec.rb  |   50 +
 .../refresh/refresher_graph_target_vm_spec.rb      |    6 +-
 .../refresh/ovirt_sdk_refresh_graph_target_vm.yml  |   18 +
 .../ovirt_sdk_refresh_recording_custom_attrs.yml   | 6833 ++++++++++++++++++++
 9 files changed, 6934 insertions(+), 9 deletions(-)
 create mode 100644 spec/models/manageiq/providers/redhat/infra_manager/refresh/refresher_4_custom_attributes_spec.rb
 create mode 100644 spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/ovirt_sdk_refresh_recording_custom_attrs.yml

Comment 6 Ilanit Stein 2018-09-17 13:04:44 UTC
Verified on CFME-5.10.0.15(graph refresh is ON, by default)/RHV-4.2.3:


1. Have a Down VM on RHV provider, that has no custom attributes set.
** On CFME side, VM details page, there is no "Custom attributes field (and this is expected).  
2. On RHV side, Edit VM, Advanced Options, set Custom attribute sap_agent == false.
3. Check in CFME, in the VM's details page, the VC custom attribute field exist, and contain sap_agent: false.