Bug 1408584

Summary: [RFE] Host cpu type is not found anywhere in REST API
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: RestAPIAssignee: Steven Rosenberg <srosenbe>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, michal.skrivanek, rbarry, sgoodman, srosenbe
Target Milestone: ovirt-4.3.0Keywords: FutureFeature
Target Release: ---Flags: rbarry: ovirt-4.3?
rule-engine: planning_ack?
rule-engine: devel_ack+
lsvaty: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.0_rc Doc Type: Enhancement
Doc Text:
Previously the REST API did not include the CPU Type when it returned information about the host. Now, the CPU Type is included with the rest of the information concerning the host that the REST API returns, which is consistent with the Administration Portal.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-13 07:46:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sefi litmanovich 2016-12-25 12:06:26 UTC
Description of problem:
The host cpu type can be found in UI under the Hosts tab -> General sub-tab - Hardware sub-tab and specifies the specific cpu model which is used on the host e.g. Intel Conroe Family.
In REST API this value is nowhere to be found. It doesn't exist under the host's cpu or hardware_information or os attributes, not with All-content flag set to True as well.
Could be nice to add it.

Version-Release number of selected component (if applicable):
ovirt-engine-4.1.0-0.2.master.20161218144454.gitbaa2853.el7.centos.noarch

How reproducible:
always

Steps to Reproduce:
1. Install some host in rhevm.
2.
3.

Actual results:
The host cpu type can be found in UI but not in REST API

Expected results:
cpu type exist as a sub attribute of host's cpu or harware_information attributes in REST API.

Additional info:

Comment 1 Yaniv Kaul 2016-12-26 08:32:46 UTC
Was it there in the past?
'Could be nice to add it' sounds like a RFE to me?

Comment 2 Juan Hernández 2016-12-26 09:43:06 UTC
I see this using latest master and version 4 of the API:

  <cpu>
    <name>Intel Core Processor (Skylake)</name>
    <speed>2808</speed>
    <topology>
      <cores>1</cores>
      <sockets>1</sockets>
      <threads>1</threads>
    </topology>
  </cpu>

Also with version 3 of the API, but a bit different:

  <cpu>
    <topology sockets="1" cores="1" threads="1"/>
    <name>Intel Core Processor (Skylake)</name>
    <speed>2808</speed>
  </cpu>

Is that what you are looking for? Isn't it reported in your environment?

Note also that there is an small chance that the information isn't reported, if the GetCapabilities VDS command hasn't been executed for that host yet.

Comment 3 sefi litmanovich 2016-12-27 09:52:41 UTC
(In reply to Juan Hernández from comment #2)
> I see this using latest master and version 4 of the API:
> 
>   <cpu>
>     <name>Intel Core Processor (Skylake)</name>
>     <speed>2808</speed>
>     <topology>
>       <cores>1</cores>
>       <sockets>1</sockets>
>       <threads>1</threads>
>     </topology>
>   </cpu>
> 
> Also with version 3 of the API, but a bit different:
> 
>   <cpu>
>     <topology sockets="1" cores="1" threads="1"/>
>     <name>Intel Core Processor (Skylake)</name>
>     <speed>2808</speed>
>   </cpu>
> 
> Is that what you are looking for? Isn't it reported in your environment?
> 
> Note also that there is an small chance that the information isn't reported,
> if the GetCapabilities VDS command hasn't been executed for that host yet.

I have a setup with 4 hosts, I refreshed capabilities as well. I think the thing is that on some cpus the name includes the type but for some it doesn't. I Have 2 Opeteron G1 hosts, 1 penryn and 1 sandyBridge. What I see in api under <cpu><name> is:

<name>Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz</name>
<name>Intel(R) Xeon(R) CPU E3-1280 V2 @ 3.60GHz</name>
<name>AMD Opteron(tm) Processor 4170 HE</name>
<name>AMD Opteron(tm) Processor 4170 HE</name>

These values corresponds to the cpuModel value that is returned in getVdsCaps cmd, but the thing is that there is some inconsistencies in the system in all that concerns cpu type values.
e.g. in cluster the value would be 'Intel Conroe Family', on vm level (if you want to pass custom_cpu_model e.g.) it would be 'intel_Conroe' or just 'Conroe'.
Maybe we can add another sub-attribute that specifies the model family, or passes the highest model from cpuFlags list?

I will change the bug to an RFE as Yaniv suggests.

Comment 4 Ryan Barry 2018-11-06 23:03:13 UTC
Targeting this due to the CPU deprecations

Comment 9 Steven Rosenberg 2018-11-29 13:09:40 UTC
The CPU Type has now been added to the REST API's cpu section:

<cpu>
<name>Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz</name>
<speed>3900</speed>
<topology>
<cores>4</cores>
<sockets>1</sockets>
<threads>2</threads>
</topology>
<type>Intel Haswell-noTSX IBRS SSBD Family</type>
</cpu>

Comment 10 Petr Matyáš 2018-12-11 12:13:15 UTC
Verified on ovirt-engine-4.3.0-0.6.alpha2.el7.noarch

Comment 11 Sandro Bonazzola 2019-02-13 07:46:37 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Comment 12 Steve Goodman 2019-02-20 15:25:03 UTC
Steven, I edited the doc text. Is this accurate:

Previously the REST API did not include the CPU Type when it returned information about the host. Now, the CPU Type is part of the information about the host that the REST API returns, consistent with the Administration Portal.

Comment 13 Steven Rosenberg 2019-02-20 16:04:49 UTC
It is OK, I might say: 

Now, the CPU Type is included with the rest of the information concerning the host that the REST API returns which is consistent with the Administration Portal.