Bug 1176820
Summary: | Failed to set user defined scheduling policy via REST | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Artyom <alukiano> |
Component: | ovirt-engine | Assignee: | Roman Mohr <rmohr> |
Status: | CLOSED ERRATA | QA Contact: | Artyom <alukiano> |
Severity: | high | Docs Contact: | |
Priority: | urgent | ||
Version: | 3.5.0 | CC: | bazulay, dfediuck, gklein, iheim, istein, lsurette, mgoldboi, mtessun, rbalakri, rgolan, Rhev-m-bugs, yeylon, ykaul, ylavi |
Target Milestone: | ovirt-3.6.1 | Keywords: | Triaged |
Target Release: | 3.6.1 | Flags: | mgoldboi:
Triaged+
|
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Prior to Red Hat Enterprise Virtualization 3.5, the <policy>name</policy> tag was used to define the name of the scheduling policy to select. In 3.5, the <name>name</name> tag was introduced. By accident the policy tag was removed, which should be there for backward compatibility. As a result, user REST scripts for setting scheduling policies sometimes did not work. With this release, support for the <policy/> tag has been re-added. The <policy/> tag can now be used again, but <name/> is preferred if it is also present.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-03-09 20:53:39 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | SLA | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Artyom
2014-12-23 11:45:03 UTC
In the past scheduling policies used to be built-in entities, but recently they have been promoted to regular entities that the user can add/modify/delete. This means that the "policy" attribute can now be anything. But we didn't take this into account when we validate the value. However, take into account that the recommended way to reference a scheduling policy is using the "id" or "name" attributes, so you could add the scheduling policy to the cluster with requests like this (using the id): PUT /clusters/{cluster:id} <cluster> <scheduling_policy id="{schedulingpolicy:id}"/> </cluster> Or this (using the name): PUT /clusters/{cluster:id} <cluster> <scheduling_policy> <name>{schedulingpolicy:name}</name> </scheduling_policy> </cluster> Using the "policy" attribute should work at least for the old built-in scheduling policies. It is good if it works for the new ones as well, but not a must in my opinion. Anyhow, users (including the Python SDK) tend to update entities taking a complete entity and sending it again with all the attributes, not just the modified ones, so this problem will appear in many use cases. I think that we should at least remove the validation of the policy type that we have in SchedulingPolicyValidator, and it would be good to also make sure that the "policy" attribute is accepted like "id" and "name" are. Thanks to Juan Just checked the code and tried to reproduce the error. The property <policy/> does not exist anymore in 3.6. Only <name/> and <id/> can be used. The comment of Juan perfectly describes the situation in 3.5. <policy/> property can be used to add internal policies to the cluster, for custom policies <name/> or <id/> must be used. Verified on rhevm-restapi-3.6.0.3-0.1.el6.noarch <cluster> <scheduling_policy> <name>test_policy</name> </scheduling_policy> </cluster> Works fine. 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/RHEA-2016-0376.html |