Bug 1335658 - Automate Storage Service Model missing association to Storage Clusters
Summary: Automate Storage Service Model missing association to Storage Clusters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.6.0
Assignee: Lucy Fu
QA Contact: Dmitry Misharov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-12 19:20 UTC by Greg McCullough
Modified: 2018-06-25 14:58 UTC (History)
5 users (show)

Fixed In Version: 5.6.0.7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 16:02:05 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

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


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