Bug 1337181 - Disable VM host-host-passthrough mode not save on backward compatibility to API version 3
Summary: Disable VM host-host-passthrough mode not save on backward compatibility to A...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.0.0-rc
: 4.0.0
Assignee: Juan Hernández
QA Contact: Artyom
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-18 12:33 UTC by Artyom
Modified: 2018-01-11 06:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-05 07:46:06 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.0.0+
rule-engine: blocker+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 57708 0 master MERGED restapi: Ignore invalid vm.cpu.mode in V3 2016-05-19 15:29:41 UTC

Description Artyom 2016-05-18 12:33:22 UTC
Description of problem:
Under 3.6, I had possibility to disable host-passthrough mode, with the request:
<vm>
  <cpu>
    <mode>none</mode>
  </cpu>
</vm>,
if I try the same request under 4.0 with API version 3, I receive the error:
<fault>
<detail>The string 'host-model' isn't a valid value for the 'CpuMode' enumerated type. Valid values are: 'custom', 'host-model', 'host-passthrough'.</detail>
<reason>Invalid value</reason>
</fault>

Version-Release number of selected component (if applicable):
ovirt-engine-restapi-4.0.0-0.0.master.20160516171427.git0860aa2.el7.centos.noarch

How reproducible:
Always

Steps to Reproduce:
1. Disable VM host-passthrough mode, with the request:
<vm>
  <cpu>
    <mode>none</mode>
  </cpu>
</vm>
2.
3.

Actual results:
<fault>
<detail>The string 'host-model' isn't a valid value for the 'CpuMode' enumerated type. Valid values are: 'custom', 'host-model', 'host-passthrough'.</detail>
<reason>Invalid value</reason>
</fault>

Expected results:
Request must succeed, and disable VM host-passthrough mode 

Additional info:
Also, I do not really understand why we have such error message, VM host-passthrough mode or enabled or disabled, what is host-model mode?

Comment 1 Juan Hernández 2016-05-18 18:20:58 UTC
The value "none" wasn't never a valid value for that parameter, but the in 3.6 we happened to ignore any non-recognized value, which is wrong. Version 4 the engine is more strict in these regards, it rejects any value that isn't valid, thus the error message.

To solve this issue we will modify the V3 to V4 translation layer so that unrecognized values of this specific parameter are ignored. But if "none" should be a valid value then it should be added to the "CpuMode" enum in the specification of the API, and handled correctly. Michal, should we add "none" as a valid value?

Comment 2 Red Hat Bugzilla Rules Engine 2016-05-18 18:21:04 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Juan Hernández 2016-05-18 19:05:59 UTC
Regarding the meaning of the values, according to the code "host_passthrough" means enable passthrough. The two others, both "custom" and "host_model", mean exactly the same: disable passthrough. I don't know if they had any other meaning in the past, but at the moment I'd say that we should probably remove "custom" and "host_model" and replace it them with "none".

Comment 4 Michal Skrivanek 2016-05-23 08:21:54 UTC
sorry for late response, Roy would be able to answer better I guess you're right in comment #3

Comment 5 Artyom 2016-06-22 14:01:13 UTC
Verified on rhevm-4.0.0.4-0.1.el7ev.noarch

PUT
<vm>
<cpu>
<mode>none</mode>
</cpu>
</vm>

Works fine under API version 3

Comment 6 Sandro Bonazzola 2016-07-05 07:46:06 UTC
oVirt 4.0.0 has been released, closing current release.


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