Bug 1369694 - [RFE] Expose 'partitions' as an association from MiqAeServiceDisk
Summary: [RFE] Expose 'partitions' as an association from MiqAeServiceDisk
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
medium
medium
Target Milestone: GA
: 5.7.0
Assignee: drew uhlmann
QA Contact: Shveta
URL:
Whiteboard: automate
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-24 07:30 UTC by Peter McGowan
Modified: 2017-01-04 12:59 UTC (History)
8 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-04 12:59:50 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-2017:0012 0 normal SHIPPED_LIVE CFME 5.7.0 bug fixes and enhancement update 2017-01-04 17:50:36 UTC

Description Peter McGowan 2016-08-24 07:30:24 UTC
Description of RFE:

The 'Disk' ApplicationRecord has a has_many association to :partitions, but this is not exposed through the MiqAeServiceDisk service model. It would be a very useful to be able to access partition information via the disk service model from automate.

Could you please add 'partitions' as an association from MiqAeServiceDisk.

Version-Release number of selected component (if applicable):
5.6.1.2

Comment 2 Greg McCullough 2016-08-25 14:11:35 UTC
Peter - Would this also need to include exposing the volumes of partitions?

class Partition < ApplicationRecord
  belongs_to :disk
  belongs_to :hardware
  has_many :volumes,
  ...
end

Drew - Please work with Lucy to create the required automate service models and expose the needed relationships once we hear back from peter.

Comment 3 Peter McGowan 2016-08-25 18:03:34 UTC
Being able to access the full disk topology from automate would be useful, so yes please, volumes would be a good addition.

thanks,
Peter

Comment 4 drew uhlmann 2016-08-26 13:17:48 UTC
https://github.com/ManageIQ/manageiq/pull/10800

Comment 5 Shveta 2016-11-08 04:07:19 UTC
h = Hardware.first
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
=> #<Hardware id: 1, config_version: nil, virtual_hw_version: nil, guest_os: "ESXi", cpu_sockets: 2, bios: nil, bios_location: nil, time_sync: nil, annotation: nil, vm_or_template_id: nil, memory_mb: 8191, host_id: 1, cpu_speed: 2400, cpu_type: "Intel(R) Xeon(R) CPU E5-2440 0 @ 2.40GHz", size_on_disk: nil, manufacturer: "VMware, Inc.", model: "VMware Virtual Platform", number_of_nics: 1, cpu_usage: 89, memory_usage: 1224, cpu_cores_per_socket: 1, cpu_total_cores: 2, vmotion_enabled: false, disk_free_space: nil, disk_capacity: nil, guest_os_full_name: "ESXi", memory_console: nil, bitness: nil, virtualization_type: nil, root_device_type: nil, computer_system_id: nil, disk_size_minimum: nil, memory_mb_minimum: nil, introspected: nil, provision_state: nil>


irb(main):002:0> h.partitions
=> #<ActiveRecord::Associations::CollectionProxy []>


irb(main):003:0> $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
=> #<MiqAeMethodService::MiqAeService:0x0000000a422890 @drb_server_references=[], @inputs={}, @workspace=#<MiqAeEngine::MiqAeWorkspaceRuntime:0x0000000a422ca0 @readonly=false, @nodes=[], @current=[], @datastore_cache={}, @class_methods={}, @dom_search=#<MiqAeEngine::MiqAeDomainSearch:0x0000000a422a70 @fqns_id_cache={}, @fqns_id_class_cache={}, @partial_ns=[], @prepend_namespace=nil>, @persist_state_hash={}, @current_state_info={}, @state_machine_objects=[], @ae_user=nil>, @preamble_lines=0, @body=[], @persist_state_hash={}, @logger=#<Vmdb::Loggers::MirroredLogger:0x0000000203ea60 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x0000000203e9e8 @datetime_format=nil>, @formatter=#<VMDBLogger::Formatter:0x0000000203e880 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x0000000203e998 @shift_size=1048576, @shift_age=0, @filename=#<Pathname:/var/www/miq/vmdb/log/automation.log>, @dev=#<File:/var/www/miq/vmdb/log/automation.log>, @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x0000000203e970>>, @write_lock=#<Thread::Mutex:0x0000000203e858>, @local_levels={}, @mirror_prefix="<AutomationEngine> ", @mirror_level=1, @mirror_logger=#<VMDBLogger:0x000000020355a0 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x00000002035528 @datetime_format=nil>, @formatter=#<VMDBLogger::Formatter:0x000000020353c0 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x000000020354d8 @shift_size=1048576, @shift_age=0, @filename=#<Pathname:/var/www/miq/vmdb/log/evm.log>, @dev=#<File:/var/www/miq/vmdb/log/evm.log>, @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x00000002035488>>, @write_lock=#<Thread::Mutex:0x00000002035398>, @local_levels={}, @thread_hash_level_key=:"ThreadSafeLogger#16886480@level">>>


irb(main):004:0> h_svc = $evm.vmdb(:hardware, h.id)
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
=> #<MiqAeServiceHardware:0x51a6850 @object=#<Hardware id: 1, config_version: nil, virtual_hw_version: nil, guest_os: "ESXi", cpu_sockets: 2, bios: nil, bios_location: nil, time_sync: nil, annotation: nil, vm_or_template_id: nil, memory_mb: 8191, host_id: 1, cpu_speed: 2400, cpu_type: "Intel(R) Xeon(R) CPU E5-2440 0 @ 2.40GHz", size_on_disk: nil, manufacturer: "VMware, Inc.", model: "VMware Virtual Platform", number_of_nics: 1, cpu_usage: 89, memory_usage: 1224, cpu_cores_per_socket: 1, cpu_total_cores: 2, vmotion_enabled: false, disk_free_space: nil, disk_capacity: nil, guest_os_full_name: "ESXi", memory_console: nil, bitness: nil, virtualization_type: nil, root_device_type: nil, computer_system_id: nil, disk_size_minimum: nil, memory_mb_minimum: nil, introspected: nil, provision_state: nil>, @virtual_columns=["aggregate_cpu_speed", "allocated_disk_storage", "hostnames", "ipaddresses", "mac_addresses", "region_description", "region_number", "used_disk_storage", "v_pct_free_disk_space", "v_pct_used_disk_space"], @associations=["guest_devices", "host", "networks", "nics", "partitions", "ports", "storage_adapters", "vm"]>
irb(main):005:0>

Comment 6 Shveta 2016-11-10 03:53:30 UTC
h_svc.partitions.count
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
=> 0
h.partitions.count
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0

Comment 8 errata-xmlrpc 2017-01-04 12:59:50 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://rhn.redhat.com/errata/RHBA-2017-0012.html


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