Description of problem: The Storage model exposes a storage_clusters relationship but this is not available from automate. Version-Release number of selected component (if applicable): 5.6 How reproducible: Always Steps to Reproduce: In rails console run the following lines: # Load storage instance s = Storage.first s.storage_clusters => [] (might return an empty array if no storage clusters exist) # Load same storage instance in Automate service model $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new) ae_s = $evm.vmdb(:storage, s.id) ae_s.storage_clusters Actual results: undefined method `storage_clusters' for #<MiqAeMethodService::MiqAeServiceStorage:0x007f8db5c63a00> Expected results: Storage Clusters (or empty array) is returned.
Lucy - I think the storage model should contain a virtual_has_many for storage_clusters as well as exposing the association through the automate service model.
https://github.com/ManageIQ/manageiq/pull/8664
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/57a73d0ca0d96e5c26532709d4755b83de923ff4 commit 57a73d0ca0d96e5c26532709d4755b83de923ff4 Author: Lucy Fu <lufu> AuthorDate: Thu May 12 15:49:11 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Thu May 12 15:49:11 2016 -0400 Add association Storage Clusters to Automate Storage Service Model. https://bugzilla.redhat.com/show_bug.cgi?id=1335658 app/models/storage.rb | 1 + lib/miq_automation_engine/service_models/miq_ae_service_storage.rb | 1 + 2 files changed, 2 insertions(+)
https://github.com/ManageIQ/manageiq/pull/8079
https://github.com/ManageIQ/manageiq/pull/8473
Verified in 5.6.0.9 $evm.vmdb(:Storage).all.collect &:storage_clusters returns in my environment: => [[], [], [#<MiqAeServiceStorageCluster:0x5a4c6d0 @object=#<StorageCluster id: 33, name: "StorageCluster", ems_id: 1, created_on: "2016-06-02 10:07:35", updated_on: "2016-06-02 10:07:35", uid_ems: "group-p107665", ems_ref_obj: "--- !ruby/string:VimString\nstr: group-p107665\nxsiT...", ems_ref: "group-p107665", type: "StorageCluster", hidden: false>, @virtual_columns=["aggregate_cpu_speed", "aggregate_cpu_total_cores", "aggregate_disk_capacity", "aggregate_logical_cpus", "aggregate_memory", "aggregate_physical_cpus", "aggregate_vm_cpus", "aggregate_vm_memory", "region_description", "region_number"], @associations=["hosts", "vms"]>], [#<MiqAeServiceStorageCluster:0x5a3f264 @object=#<StorageCluster id: 33, name: "StorageCluster", ems_id: 1, created_on: "2016-06-02 10:07:35", updated_on: "2016-06-02 10:07:35", uid_ems: "group-p107665", ems_ref_obj: "--- !ruby/string:VimString\nstr: group-p107665\nxsiT...", ems_ref: "group-p107665", type: "StorageCluster", hidden: false>, @virtual_columns=["aggregate_cpu_speed", "aggregate_cpu_total_cores", "aggregate_disk_capacity", "aggregate_logical_cpus", "aggregate_memory", "aggregate_physical_cpus", "aggregate_vm_cpus", "aggregate_vm_memory", "region_description", "region_number"], @associations=["hosts", "vms"]>], [], [], [], [], [], [], [], [], [], []] Storage.all.collect &:storage_clusters returns => [[], [], [#<StorageCluster id: 33, name: "StorageCluster", ems_id: 1, created_on: "2016-06-02 10:07:35", updated_on: "2016-06-02 10:07:35", uid_ems: "group-p107665", ems_ref_obj: "--- !ruby/string:VimString\nstr: group-p107665\nxsiT...", ems_ref: "group-p107665", type: "StorageCluster", hidden: false>], [#<StorageCluster id: 33, name: "StorageCluster", ems_id: 1, created_on: "2016-06-02 10:07:35", updated_on: "2016-06-02 10:07:35", uid_ems: "group-p107665", ems_ref_obj: "--- !ruby/string:VimString\nstr: group-p107665\nxsiT...", ems_ref: "group-p107665", type: "StorageCluster", hidden: false>], [], [], [], [], [], [], [], [], [], []]
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://access.redhat.com/errata/RHBA-2016:1348