Bug 1316456

Summary: Cannot change scheduling policy cluster overrides over REST API - changes affect the global scheduling policy instead
Product: [oVirt] ovirt-engine Reporter: Roman Mohr <rmohr>
Component: RestAPIAssignee: Nobody <nobody>
Status: CLOSED WONTFIX QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: alukiano, bugs, dfediuck, lsvaty, mgoldboi, rbarry, rgolan
Target Milestone: ---Keywords: AutomationBlocker, Regression
Target Release: ---Flags: dfediuck: ovirt-4.3?
rule-engine: blocker?
rule-engine: planning_ack?
rule-engine: devel_ack?
lsvaty: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-24 00:23:27 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 Roman Mohr 2016-03-10 09:59:27 UTC
Description of problem:

The following scheduling policy description is embedded inside a cluster:
PUT /api/cluster/{cluster_id}
{
"id" : "{cluster_id}"
"scheduling_policy" : {
    "policy" : "evenly_distributed",
    "thresholds" : {
      "high" : "60",
      "duration" : "120"
    },
    "properties" : {
      "property" : [ {
        "name" : "CpuOverCommitDurationMinutes",
        "value" : "2"
      }, {
        "name" : "HighUtilization",
        "value" : "60"
      } ]
    },
    "name" : "evenly_distributed",
    "href" : "/ovirt-engine/api/schedulingpolicies/20d25257-b4bd-4589-92a6-c4c5c5d3fd1a",
    "id" : "20d25257-b4bd-4589-92a6-c4c5c5d3fd1a"
  },
 [...]
}
When you send the cluster with this embedded scheduling policy it will set the scheduling policy properties on the cluster.
When you follow the scheduling policy linkg

> "href" : "/ovirt-engine/api/schedulingpolicies/20d25257-b4bd-4589-92a6-c4c5c5d3fd1a"

and manipulate these properties there you are changing the scheduling policy itself on a system wide level and the cluster does not notice these changes.
That is inconsistent since from a user perspective always the object with the scheduling policy id

> 20d25257-b4bd-4589-92a6-c4c5c5d3fd1a

is manipulated.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create a cluster and select a scheduling policy
2. Fetch the cluster through the REST API
3. Change a scheduling policy property and PUT the changed cluster
4. Visit the UI (you might have to refresh the page) and you will see the changed property on the cluster edit dialogue
5. Follow the cluster policy link and set the porperty there to a different value
6. The cluster still sees its property values

Actual results:
In one case you are manipulationg the cluster (although you are in the scheduling policy map with its own id) and when following the link you are manipulating the scheduling policy.

Expected results:

REST API confentions suggest that the scheduling policy object should be manipulated in both cases. However we need cluster specific properties. Either they should be moved out of the scope of the scheduling policy or we need cluster specific scheduling policis.

Additional info:

Comment 1 Roman Mohr 2016-03-10 10:02:03 UTC
On 4.0 the embedded scheduling policy is now external which makes it currently impossible to set cluster scheduling properties through the REST API.

Comment 2 Sandro Bonazzola 2016-05-02 10:03:18 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 3 Yaniv Lavi 2016-05-23 13:18:23 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 4 Yaniv Lavi 2016-05-23 13:22:27 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 5 Doron Fediuck 2016-06-30 12:52:36 UTC
Moving to 4.1, as this is the current implementation and not a regression.

Comment 6 Red Hat Bugzilla Rules Engine 2016-06-30 12:52:42 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 7 Artyom 2016-06-30 13:03:38 UTC
I believe we need to up the severity, because it prevents from automation to check all built-in scheduling policies

Comment 8 Red Hat Bugzilla Rules Engine 2016-06-30 13:03:44 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 9 Roman Mohr 2016-06-30 13:10:04 UTC
(In reply to Doron Fediuck from comment #5)
> Moving to 4.1, as this is the current implementation and not a regression.

It is a regression. It is one thing that the REST-API was always misleading. But in 4.0 it is now impossible to update the properties of a policy for a cluster. You always change the "template" policy which means that you set the property for all clusters which are using this policy. This was introduced by the REST-API refactoring for 4.0.

Comment 10 Ryan Barry 2019-01-24 00:23:27 UTC
Closing, since there are no reports from the field in years, and there is a lack of capacity to work on this