Miq_templates method missing from RHEV provider?


I am trying to use an excellent Cloudforms Essentials collection of automation scripts (https://github.com/ramrexx/CloudForms_Essentials), and running into a missing method. A specific bug that I tried to file is https://github.com/ramrexx/CloudForms_Essentials/issues/3
Basically, automation script is trying to use miq_templates method, and could not find it. In my case, running against MangeIQ, ManageIQ::Providers::Redhat::InfraManager has methods:
@associations= [“ems_clusters”, “ems_events”, “ems_folders”, “hosts”, “provider”, “resource_pools”, storages", “tenant”, “vms”]
Kevin from Cloudforms Essentials, running against CloudForms, gets:
@associations=[“customization_specs”, “ems_clusters”, “ems_events”, “ems_folders”, “hosts”, “miq_templates”, “provider”, “resource_pools”, “storages”, “tenant”, “vms”]
I do not have access to CloudForms, so I cannot really test :frowning:
Should miq_templates method be available for RHEV provider, or is it a part of CloudForms add-ons?

Thank you!


@gmccullough can you review this question from @sgenchev and forward to a SME if necessary.


Hi @sgenchev,

ManageIQ and CloudForms are exactly the same for these objects. Looking at my ManageIQ environment I am seeing the same thing you are showing from the CloudForms associations.

It would be helpful if you could show the class name of the ManageIQ object you are working against.

Here’s what I am seeing if I load the automate service model in the rails console:

$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
$evm.vmdb(:ems).all.detect {|ems| ems.class.name.include?("Red")}

=> #<MiqAeServiceManageIQ_Providers_Redhat_InfraManager:0x3fe77ad224d0 @object=#<ManageIQ::Providers::Redhat::InfraManager id: 28, ...
@virtual_columns=["aggregate_cpu_speed", ...], 
@associations=["customization_specs", "ems_clusters", "ems_events", "ems_folders", "hosts", "miq_templates", "provider", "resource_pools", "storages", "tenant", "vms"]>

My guess is that you are looking at a different object on the ManageIQ side.


Thank you very much for your reply @gmccullough ,

I did your exact commands in the rails console, and I still do not have miq_templates.

$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
$evm.vmdb(:ems).all.detect {|ems| ems.class.name.include?("Red")}
=> #<MiqAeServiceManageIQ_Providers_Redhat_InfraManager:0x4dc608c @object=#<ManageIQ::Providers::Redhat::InfraManager id: 1, name: "oVirt-3.6"...
 @associations=["ems_clusters", "ems_events", "ems_folders", "hosts", "provider", "resource_pools", "storages", "tenant", "vms"]

This is on brand new capablanca-2 appliance that I spun up just for this test. The only thing I did is I have added single oVirt 3.6 provider. Could it be oVirt version? What version of oVirt/RHEV are you testing against?


I should have asked what version you were running before. The relationship was not available in the capablanca-2 release.

It was added in PR #5442 with this change:

Adding this one line to your ext_management_system service model will expose the relationship you want.


Thank you very much!

This did the trick.