Bug 1542531 - Allow ServerCPUList and ClusterEmulatedMachines options to be visible over RESTAPI
Summary: Allow ServerCPUList and ClusterEmulatedMachines options to be visible over RE...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.1.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.2.2
: ---
Assignee: Martin Perina
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-06 14:27 UTC by Simone Tiraboschi
Modified: 2018-08-27 16:14 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.2.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-29 11:10:36 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1622240 0 high CLOSED "Unknown CPU model Broadwell-IBRS-SSBD" 2021-02-22 00:41:40 UTC
oVirt gerrit 87277 0 master MERGED core: Add documentation for ClientAccessLevel 2021-01-22 11:58:35 UTC
oVirt gerrit 87278 0 master MERGED core: Expose ServerCPUList and ClusterEmulatedMachines over RESTAPI 2021-01-22 11:58:35 UTC
oVirt gerrit 87613 0 ovirt-engine-4.2 MERGED core: Add documentation for ClientAccessLevel 2021-01-22 11:57:54 UTC
oVirt gerrit 87614 0 ovirt-engine-4.2 MERGED core: Expose ServerCPUList and ClusterEmulatedMachines over RESTAPI 2021-01-22 11:57:54 UTC

Internal Links: 1622240

Description Simone Tiraboschi 2018-02-06 14:27:18 UTC
Description of problem:
Properly expose supported CPU models from REST APIs.
Cluster details returns just a human readable string like 'Intel Haswell-noTSX IBRS Family' or 'AMD Opteron G5' while tools on host side need something like 'model_Haswell-noTSX-IBRS' or 'model_Opteron_G5'.

ovirt-engine/api/options/ServerCPUList returns just a 404 HTTP ERROR


Version-Release number of selected component (if applicable):
ovirt-engine.noarch                      4.2.1.5-1.el7.centos 

How reproducible:
100%

Steps to Reproduce:
1. try to get cluster CPU model in machine consumable format
2.
3.

Actual results:
Just 'Intel Haswell-noTSX IBRS Family'

Expected results:
Also 'model_Haswell-noTSX-IBRS' somewhere

Additional info:

Comment 1 Ondra Machacek 2018-02-06 16:15:11 UTC
Which tools do you mean? When we are creating a cluster, where we pass the cpu_type, we pass the exact same value as you can see in:

 ovirt-engine/api/clusterlevels

Can you describe the use case more, please?

Comment 2 Michal Skrivanek 2018-02-06 17:49:56 UTC
Simone, I guess you are just saying https://bugzilla.redhat.com/show_bug.cgi?id=1441501#c6 doesn't work. I haven't checked that, but ovirt-web-ui uses that API today without issues

Comment 3 Simone Tiraboschi 2018-02-07 08:08:04 UTC
(In reply to Ondra Machacek from comment #1)
>  ovirt-engine/api/clusterlevels
> 
> Can you describe the use case more, please?

On ovirt-engine/api/clusterlevels I get something like
<cpu_type>
<architecture>x86_64</architecture>
<level>12</level>
<name>Intel Haswell-noTSX IBRS Family</name>
</cpu_type>

but I also need model_Haswell-noTSX-IBRS for vm.conf on hosted-engine side.


(In reply to Michal Skrivanek from comment #2)
> Simone, I guess you are just saying
> https://bugzilla.redhat.com/show_bug.cgi?id=1441501#c6 doesn't work. I
> haven't checked that, but ovirt-web-ui uses that API today without issues

/ovirt-engine/api/options/MigrationPoliciesSupported?version=4.2 (as in the example) works as expected but /ovirt-engine/api/options/ServerCPUList?version=4.2 constantly gives me a 404 HTTP ERROR.

I'm not sure that all the VdcOptions values are properly exposed.

Comment 4 Michal Skrivanek 2018-02-07 09:10:32 UTC
(In reply to Simone Tiraboschi from comment #3)

> On ovirt-engine/api/clusterlevels I get something like
> <cpu_type>
> <architecture>x86_64</architecture>
> <level>12</level>
> <name>Intel Haswell-noTSX IBRS Family</name>
> </cpu_type>
> 
> but I also need model_Haswell-noTSX-IBRS for vm.conf on hosted-engine side.

that's internal and not usable in any API. The <name> above is what you would use in Cluster definition as CPU Type.
I understand why you need that in HE but it shouldn't be part of public API.


> I'm not sure that all the VdcOptions values are properly exposed.

then that should be reported - all of them are supposed to work.

Comment 5 Simone Tiraboschi 2018-02-07 09:57:42 UTC
(In reply to Michal Skrivanek from comment #4)
> then that should be reported - all of them are supposed to work.

Done

Comment 6 Martin Perina 2018-02-07 15:47:29 UTC
Please bear in mind that not all ConfigValues stored in vdc_options table are exposed using RESTAPI /ovirt-engine/api/options, it depends on theirs ClientAccessLevel:

  User
    - users with UserRole or AdminRole can fetch the value over RESTAPI

  Admin
    - users with AdminRole can fetch the value over RESTAPI

  Internal (default value)
    - not visible over RESTAPI

For details please take a look at https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java#L1604

Comment 7 Simone Tiraboschi 2018-02-14 10:43:39 UTC
So can the user also change values there via REST API? maybe it could be worth to add also a ReadOnly attribute over ClientAccessLevel.

Comment 8 Martin Perina 2018-02-14 13:26:00 UTC
(In reply to Simone Tiraboschi from comment #7)
> So can the user also change values there via REST API? maybe it could be
> worth to add also a ReadOnly attribute over ClientAccessLevel.

No, RESTAPI access is readonly. Options exposed via engine-config can be changed by it, all others are completely readonly.

Comment 9 Radim Hrazdil 2018-02-26 10:41:48 UTC
Tested all Admin and User level options, including ServerCPUList mentioned in the description on RHV version 4.2.2.

Verified that query for ServerCPUList succeeds, as well as all other options.

Comment 10 Sandro Bonazzola 2018-03-29 11:10:36 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 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.


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