Bug 1923717 - When creating a VM via rest from a template with ballooning=false, the template's ballooning setting is ignored if memory_policy exists
Summary: When creating a VM via rest from a template with ballooning=false, the templa...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.4.5
: ---
Assignee: Liran Rotenberg
QA Contact: Polina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-01 17:30 UTC by Sharon Gratch
Modified: 2021-03-18 15:16 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.4.5.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-18 15:16:06 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 113526 0 master MERGED core: refactor ballooning support 2021-02-17 15:47:20 UTC
oVirt gerrit 113527 0 master MERGED api: fix balloon settings on add vm 2021-02-17 14:59:53 UTC

Description Sharon Gratch 2021-02-01 17:30:21 UTC
Description of problem:
When creating a VM via REST from a template with ballooning=false (e.g. a high performance template) then if memory_policy element exists in api query without specifically setting the ballooning attribute (even an empty memory_policy element without any attributes), then the ballooning is always set to true, regardless to template ballooning settings.


This issue is reproduced for all VM types (not just high performance) and it causes the VM created by rest to differ from the one created by webadmin for that specific scenario.

Note that for web-ui it's always reproduced since a VM on web-ui is always created with memory_policy element set.

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

How reproducible:
100%

Steps to Reproduce:
1. create a template" with ballooning=false (template->Resource Allocation->"Memory Ballooning Enabled" is disabled).

2. create a VM via REST query that is based on that template in (1) and includes a "memory_policy" element without the "ballooning" attribute :
e.g.
<vm>
<cluster>
<name>cluster</name>
</cluster>
<name>vm1</name>
<template><name>temp_with_balloon_disabled</name></template>
<memory_policy>
<guaranteed>10</guaranteed>
</memory_policy>
</vm>

OR
create a VM via web-ui that is based on that template in (1).

Actual results:
the created provisioned VM "vm1" is configured with ballooning=true

Expected results:
the created provisioned VM "vm1" should be configured with ballooning=false

Comment 1 Arik 2021-02-02 08:20:23 UTC

*** This bug has been marked as a duplicate of bug 1897532 ***

Comment 2 Liran Rotenberg 2021-02-16 12:27:46 UTC
I'm reopening this bug.

In bug 1897532 the issue is about creating VM pool and taking the ballooning settings from the template.

Here, we have the flow of creating a VM from template.

Sharon, on the second step to reproduce:
"OR
create a VM via web-ui that is based on that template in (1)."

I didn't manage to reproduce it via the webadmin. Did you mean anything else? On the API it does reproduce.

Comment 3 Sharon Gratch 2021-02-17 11:32:17 UTC
(In reply to Liran Rotenberg from comment #2)
> I'm reopening this bug.
> 
> In bug 1897532 the issue is about creating VM pool and taking the ballooning
> settings from the template.
> 
> Here, we have the flow of creating a VM from template.
> 
> Sharon, on the second step to reproduce:
> "OR
> create a VM via web-ui that is based on that template in (1)."
> 
> I didn't manage to reproduce it via the webadmin. Did you mean anything
> else? On the API it does reproduce.

web-ui means VM portal and not webadmin. The VM portal callls the API for creating a VM based on a template and set the "memory_policy" element for setting the VM's memory size.
But as mentioned, it's reproduced via the API directly as well.

Comment 4 Sharon Gratch 2021-02-17 11:34:31 UTC
> (In reply to Liran Rotenberg from comment #2)
> > I'm reopening this bug.
> > 
> > In bug 1897532 the issue is about creating VM pool and taking the ballooning
> > settings from the template.
> > 
> > Here, we have the flow of creating a VM from template.
> > 
> > Sharon, on the second step to reproduce:
> > "OR
> > create a VM via web-ui that is based on that template in (1)."
> > 
> > I didn't manage to reproduce it via the webadmin. Did you mean anything
> > else? On the API it does reproduce.
> 
> web-ui means VM portal and not webadmin. The VM portal callls the API for
> creating a VM based on a template and set the "memory_policy" element for
> setting the VM's memory size.
> But as mentioned, it's reproduced via the API directly as well.

It was raised on web-ui by this issue: https://github.com/oVirt/ovirt-web-ui/pull/1362#pullrequestreview-590415468

Comment 5 Polina 2021-03-02 14:37:07 UTC
verified on ovirt-engine-4.4.5.6-0.11.el8ev.noarch
both scenarios - rest API and VM Portal

Comment 6 Sandro Bonazzola 2021-03-18 15:16:06 UTC
This bugzilla is included in oVirt 4.4.5 release, published on March 18th 2021.

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