Bug 1335658

Summary: Automate Storage Service Model missing association to Storage Clusters
Product: Red Hat CloudForms Management Engine Reporter: Greg McCullough <gmccullo>
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: jhardy, mkanoor, obarenbo, simaishi, tfitzger
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.6.0.7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 16:02:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Greg McCullough 2016-05-12 19:20:31 UTC
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.

Comment 2 Greg McCullough 2016-05-12 19:23:07 UTC
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.

Comment 4 CFME Bot 2016-05-12 23:15:49 UTC
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(+)

Comment 7 Milan Falešník 2016-06-02 11:54:13 UTC
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>], [], [], [], [], [], [], [], [], [], []]

Comment 9 errata-xmlrpc 2016-06-29 16:02:05 UTC
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