Bug 1487735
Summary: | cpu_usagemhz_rate_average is 0 for RHV 4 VMs | |||
---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Tasos Papaioannou <tpapaioa> | |
Component: | C&U Capacity and Utilization | Assignee: | Boriso <bodnopoz> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Tasos Papaioannou <tpapaioa> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 5.8.0 | CC: | bsorota, gblomqui, jhardy, jocarter, obarenbo, simaishi | |
Target Milestone: | GA | Keywords: | TestOnly | |
Target Release: | 5.10.0 | |||
Hardware: | All | |||
OS: | All | |||
Whiteboard: | ||||
Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1527663 1549833 (view as bug list) | Environment: | ||
Last Closed: | 2018-06-21 20:34:27 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | Bug | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | RHEVM | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1527663, 1549833 |
Description
Tasos Papaioannou
2017-09-01 18:41:37 UTC
It looks like the problem is in the ovirt_metrics gem. The cpu_usagemhz_rate_average value is calculated in VmSamplesHistory: **** /opt/rh/cfme-gemset/gems/ovirt_metrics-1.4.1/lib/ovirt_metrics/models/vm_samples_history.rb: module OvirtMetrics class VmSamplesHistory < OvirtHistory belongs_to :host_configuration, :foreign_key => :current_host_configuration_version belongs_to :vm_configuration, :foreign_key => :vm_configuration_version def cpu_usagemhz_rate_average speed_of_host = self.host_configuration.try(:speed_in_mhz).to_f [...] speed_of_host * (self.cpu_usage_percent.to_f / 100.0) end **** speed_in_mhz is defined in HostConfiguration: **** /opt/rh/cfme-gemset/gems/ovirt_metrics-1.4.1/lib/ovirt_metrics/models/host_configuration.rb: module OvirtMetrics class HostConfiguration < OvirtHistory [...] GHZ_REGEX = /.*\@\s*(\d+\.\d+)GHz/ MHZ_REGEX = /.*\@\s*(\d+\.\d+)MHz/ def speed_in_mhz if self.cpu_model.respond_to?(:match) match = self.cpu_model.match(GHZ_REGEX) return (match[1].to_f * 1024) if match match = self.cpu_model.match(MHZ_REGEX) return match[1].to_f if match end return nil end end end **** The RHV 4 host that is causing this issue does not have a CPU speed within the cpu_model string: ovirt_engine_history=# select history_id, host_name, number_of_cores, cpu_speed_mh, cpu_model from host_configuration where history_id=4717; history_id | host_name | number_of_cores | cpu_speed_mh | cpu_model ------------+--------------+-----------------+--------------+----------------------------------------------- 4717 | host_mixed_1 | 4 | 2095 | Intel Celeron_4x0 (Conroe/Merom Class Core 2) (1 row) whereas a working host does: ovirt_engine_history=# select history_id, host_name, number_of_cores, cpu_speed_mh, cpu_model from host_configuration where history_id=123728; history_id | host_name | number_of_cores | cpu_speed_mh | cpu_model ------------+--------------------------------------+-----------------+--------------+------------------------------------------------- 123728 | qeblade32.rhq.lab.eng.bos.redhat.com | 8 | 2128 | Intel(R) Xeon(R) CPU L5518 @ 2.13GHz (1 row) So I guess this isn't a RHV version-specific issue so much as caused by how certain host models display their CPU Version host in dmidecode or however RHV captures the info to store in cpu_model. It seems strange to me that CFME is grepping for a GHz or MHz value in the cpu_model column of the host_configuration table, when the numeric cpu_speed_mh column also exists and would be more reliable. New commit detected on ManageIQ/ovirt_metrics/master: https://github.com/ManageIQ/ovirt_metrics/commit/73cd2e182762d9e3020e2b7f8e4c2fe8f4829b01 commit 73cd2e182762d9e3020e2b7f8e4c2fe8f4829b01 Author: Boris Odnopozov <bodnopoz> AuthorDate: Wed Nov 8 14:36:57 2017 +0200 Commit: Boris Odnopozov <bodnopoz> CommitDate: Wed Nov 29 10:07:33 2017 +0200 Fix fetching cpu speed Fix fetching cpu speed. This is to resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1487735 lib/ovirt_metrics/models/host_configuration.rb | 14 - lib/ovirt_metrics/models/host_samples_history.rb | 2 +- lib/ovirt_metrics/models/vm_samples_history.rb | 2 +- spec/models/host_configuration_spec.rb | 31 -- spec/models/host_samples_history_spec.rb | 20 +- spec/models/vm_disk_samples_history_spec.rb | 8 +- spec/models/vm_samples_history_spec.rb | 11 +- spec/schemas/schema_rhev30.rb | 655 ----------------------- spec/support/active_record.rb | 6 - 9 files changed, 19 insertions(+), 730 deletions(-) delete mode 100644 spec/models/host_configuration_spec.rb delete mode 100644 spec/schemas/schema_rhev30.rb New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/34a1528e9536b81ad74b1645dce8186df4e6cafb commit 34a1528e9536b81ad74b1645dce8186df4e6cafb Author: Boris Odnopozov <bodnopoz> AuthorDate: Thu Dec 7 13:29:49 2017 +0200 Commit: Boris Odnopozov <bodnopoz> CommitDate: Thu Dec 7 13:29:49 2017 +0200 Bumping the ovirt_metrics gem version Several bug fixes are included in the new release, including: https://bugzilla.redhat.com/show_bug.cgi?id=1495133 https://bugzilla.redhat.com/show_bug.cgi?id=1487735 Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) |