Bug 1897532

Summary: VmPool created without ballooning when template has ballooning enabled
Product: [oVirt] ovirt-engine Reporter: nicolas
Component: BLL.VirtAssignee: Liran Rotenberg <lrotenbe>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4.0CC: ahadas, bugs, dfodor, juan.hernandez, lrotenbe, mperina, sgratch
Target Milestone: ovirt-4.4.5Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.5.8 Doc Type: Bug Fix
Doc Text:
Previously, creating VmPool with the API didn't respect the template ballooning configuration. Now, the VmPool will inherit it from the template unless explicitly provided.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-18 15:13:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Ballooning disabled none

Description nicolas 2020-11-13 11:19:13 UTC
Created attachment 1729063 [details]
Ballooning disabled

Description of problem:

We're using oVirt 4.3.8 along with ovirt-engine-sdk-python (4.4.1) to handle our pools.

Pools are based on a template which has ballooning enabled. However, when deploying a VmPool based on that template, it has the "Ballooning enabled" field disabled, uneditable and an icon which states: "The field is not attached to any instance type" (screenshot attached).

We're handling a big number of VMs based on pools (> 1500), and we think this should be enabled.

When creating the VmPool from the GUI, it's created correctly with Ballooning enabled.

According to Michal Skrivanek, this looks like a bug.

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

4.4.1

How reproducible:

Always

Steps to Reproduce:

Create a VmPool using this snippet:

    newpool = types.VmPool(name='test',
                           cluster=cl,
                           template=t,
                           max_user_vms=1,
                           size=1,
                           type=types.VmPoolType.MANUAL)
    vmpool_serv.add(newpool)


cl is a types.Cluster instance with ballooning_enabled=True
t is a types.Template instance of a template with Ballooning enabled.

Actual results:

A VM pool with ballooning disabled is created. 

Expected results:

A VM pool with ballooning enabled should be created.

Comment 1 RHEL Program Management 2020-11-16 11:48:50 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 2 Ori Liel 2021-01-04 09:33:03 UTC
First of all, from looking at the code, this should work as a work-around: 

  
  POST  ...api/vmpools

    <vm_pool>
      <name>test</name>
      .
      .
      .
      <vm>
        <memory_policy>
          <ballooning>true</ballooning>
        </memory_policy>
      </vm>
    <vm_pool>

As for the bug, the solution should be that if ballooning isn't provided explicitly (as in above example), 
the API layer should leave it empty and let AddVmPoolCommand infer it from the Template. 

Right now the API layer must choose a value for AddVmPoolParameters.balloonEnalbed, because balloonEnalbed
is defined as a primitive, so it must contain a value (in this case - true/false) and may not be null.

Comment 5 Arik 2021-02-02 08:20:23 UTC
*** Bug 1923717 has been marked as a duplicate of this bug. ***

Comment 6 Polina 2021-03-11 16:26:39 UTC
Verified on ovirt-engine-4.4.5.9-0.1.el8ev.noarch

template and cluster are set with ballooning enabled . In this case send 
POST https://{{host}}/ovirt-engine/api/vmpools
<vm_pool>
    <name>pool</name>
    <size>2</size>
    <cluster>
        <name>golden_env_mixed_1</name>
    </cluster>
    <template id="f1d8655a-2d0a-48d3-be4d-e0bb2f37168e"/>
    <vm/>
</vm_pool>

creates pool with the ballooning enabled

Comment 7 Sandro Bonazzola 2021-03-18 15:13:45 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.