Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1335658 - Automate Storage Service Model missing association to Storage Clusters
Automate Storage Service Model missing association to Storage Clusters
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
5.6.0
Unspecified Unspecified
unspecified Severity high
: GA
: 5.6.0
Assigned To: Lucy Fu
Dmitry Misharov
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-12 15:20 EDT by Greg McCullough
Modified: 2018-06-25 10:58 EDT (History)
5 users (show)

See Also:
Fixed In Version: 5.6.0.7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 12:02:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 14:50:04 EDT

  None (edit)
Description Greg McCullough 2016-05-12 15:20:31 EDT
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 15:23:07 EDT
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 19:15:49 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/57a73d0ca0d96e5c26532709d4755b83de923ff4

commit 57a73d0ca0d96e5c26532709d4755b83de923ff4
Author:     Lucy Fu <lufu@redhat.com>
AuthorDate: Thu May 12 15:49:11 2016 -0400
Commit:     Lucy Fu <lufu@redhat.com>
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 07:54:13 EDT
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 12:02:05 EDT
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.