Bug 1369694
| Summary: | [RFE] Expose 'partitions' as an association from MiqAeServiceDisk | ||
|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Peter McGowan <pmcgowan> |
| Component: | Automate | Assignee: | drew uhlmann <duhlmann> |
| Status: | CLOSED ERRATA | QA Contact: | Shveta <sshveta> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 5.6.0 | CC: | jhardy, mkanoor, obarenbo, pmcgowan, simaishi, sshveta, tfitzger, WilliamC.Elliott |
| Target Milestone: | GA | Keywords: | FutureFeature |
| Target Release: | 5.7.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | automate | ||
| Fixed In Version: | 5.7.0.0 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-01-04 12:59:50 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
Peter McGowan
2016-08-24 07:30:24 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. Being able to access the full disk topology from automate would be useful, so yes please, volumes would be a good addition. thanks, Peter 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>
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 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 |