Bug 1732349 - Unexpected error while accessing scvmm templates
Summary: Unexpected error while accessing scvmm templates
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.11.0
Assignee: Adam Grare
QA Contact: John Dupuy
Red Hat CloudForms Documentation
URL:
Whiteboard:
: 1726426 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-23 08:26 UTC by Ganesh Hubale
Modified: 2019-12-13 15:01 UTC (History)
10 users (show)

Fixed In Version: 5.11.0.17
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-13 15:01:38 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)
Unexpcted error on template details page (77.40 KB, image/png)
2019-07-23 08:26 UTC, Ganesh Hubale
no flags Details

Description Ganesh Hubale 2019-07-23 08:26:02 UTC
Created attachment 1592826 [details]
Unexpcted error on template details page

Description of problem:


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

How reproducible:
100%

Steps to Reproduce:
1. Add scvmm provider and go to details page
2. Click on 'Templates' from 'Relationships' table 
3. Click on any template(like centos-tmpl, fedora-small-tmpl etc)

Actual results:
Unexpected error encountered

Expected results:


Additional info:
- Working as expected on 5.10z

Comment 5 Dávid Halász 2019-07-24 07:32:02 UTC
I was able to reproduce this to the model, possibly a provider issue as it is happening for SCVMM only. The VmOrTemplate#find is behaving inconsistently.
When calling with a VMware template:

VmOrTemplate.find(196) -> returns `ManageIQ::Providers::Vmware::InfraManager::Template`

When calling with a SCVMM template:
VmOrTemplate.find(246) -> returns `MiqTemplate`

Looking into this a little bit more, the `type` field for the given template record is set to `MiqTemplate` instead of `ManageIQ::Providers::Microsoft::InfraManager::Template`.
This causes the `ManageIQ::Providers::Microsoft::InfraManager::Template` class return no templates at all.

Comment 7 CFME Bot 2019-07-24 18:03:11 UTC
New commit detected on ManageIQ/manageiq-providers-scvmm/master:

https://github.com/ManageIQ/manageiq-providers-scvmm/commit/fb097ec4a0388e86e2c726e6359d3ccad5d2191d
commit fb097ec4a0388e86e2c726e6359d3ccad5d2191d
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Wed Jul 24 12:01:51 2019 -0400
Commit:     Adam Grare <agrare@redhat.com>
CommitDate: Wed Jul 24 12:01:51 2019 -0400

    Fix the SCVMM template type, was just MiqTemplate

    The auto-model-class feature of the persister builder wasn't picking up
    the class correctly because it was looking for
    ManageIQ::Providers::Microsoft::InfraManager::MiqTemplate instead of
    ...InfraManager::Template.

    This caused the templates that got created to have the base model type
    of MiqTemplate.

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

 app/models/manageiq/providers/microsoft/inventory/persister/infra_manager.rb | 2 +-
 spec/models/manageiq/providers/microsoft/infra_manager/refresher_spec.rb | 12 +
 2 files changed, 13 insertions(+), 1 deletion(-)

Comment 8 CFME Bot 2019-07-25 21:42:51 UTC
New commit detected on ManageIQ/manageiq-providers-scvmm/ivanchuk:

https://github.com/ManageIQ/manageiq-providers-scvmm/commit/cd02fe23c4fdb9030e4585f08a82f581809e9ebb
commit cd02fe23c4fdb9030e4585f08a82f581809e9ebb
Author:     Gregg Tanzillo <gtanzill@redhat.com>
AuthorDate: Wed Jul 24 13:59:23 2019 -0400
Commit:     Gregg Tanzillo <gtanzill@redhat.com>
CommitDate: Wed Jul 24 13:59:23 2019 -0400

    Merge pull request #127 from agrare/bz_1732349_fix_scvmm_template_type

    Fix the SCVMM template type, was just MiqTemplate

    (cherry picked from commit 3050c8a269a34540ef91aec2518752e0e963d02b)

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

 app/models/manageiq/providers/microsoft/inventory/persister/infra_manager.rb | 2 +-
 spec/models/manageiq/providers/microsoft/infra_manager/refresher_spec.rb | 12 +
 2 files changed, 13 insertions(+), 1 deletion(-)

Comment 9 John Dupuy 2019-07-26 15:38:05 UTC
*** Bug 1726426 has been marked as a duplicate of this bug. ***

Comment 10 Ievgen Zapolskyi 2019-07-29 16:55:11 UTC
scvmm templates aren't available in provisioning dialog and in Compute->Infrastructure->Virtual Machines->Templates as well.

Comment 11 John Dupuy 2019-07-31 18:04:47 UTC
Verified in SCVMM 5.11.0.17: 

Templates are showing up in all expected locations and I can view their details pages without hitting the unexpected error.


Note You need to log in before you can comment on or make changes to this bug.