Bug 1940529

Summary: [RFE] Set guaranteed memory of VM according to its defined memory when not specified
Product: [oVirt] ovirt-engine Reporter: Guilherme Santos <gdeolive>
Component: RestAPIAssignee: Arik <ahadas>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.4.5CC: ahadas, bugs, mburman, michal.skrivanek
Target Milestone: ovirt-4.4.7Keywords: FutureFeature, ZStream
Target Release: 4.4.7Flags: ahadas: ovirt-4.4?
pm-rhel: planning_ack?
pm-rhel: devel_ack+
gdeolive: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-06 07:28:33 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:

Description Guilherme Santos 2021-03-18 15:24:51 UTC
Description of problem:
when deploying a vm using api/sdk, setting the memory value doesn't automatically change the value of guarantee_memory like it does when selecting it through web-ui.
I don't see this as a problem itself, however the default value of guarantee_memory is 1Gb which, IMHO, it's too little for most the use cases (RHEL6 asks for at least 2Gb of memory required). 
Some situations, such as machines for kubernetes/openshift which are resource hungry and have the deployment of the vms automated, can be very affected by this silent memory overcommit 


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

How reproducible:
always

Steps to Reproduce:
1. deploy vm using api/sdk setting memory but not setting guarantee_memory
2. check the guarantee_memory in the web-ui
3.

Actual results:
1Gb of guarantee_memory

Expected results:
at least 2Gb or automatically depending of the memory value (like in the web-ui)

Additional info:

Comment 2 Michal Skrivanek 2021-03-19 10:54:57 UTC
defaults are coming form Blank template

would you want to turn this into an RFE?

Comment 3 Arik 2021-03-22 12:22:31 UTC
We can alternatively make rest-api imitate what the UI does when the guaranteed memory is not specified through the API

Comment 4 Michal Skrivanek 2021-03-25 14:30:12 UTC
(In reply to Arik from comment #3)
> We can alternatively make rest-api imitate what the UI does when the
> guaranteed memory is not specified through the API

you mean backend, right, as we're not putting any logic into the rest api layer.

Comment 5 Arik 2021-03-25 15:48:41 UTC
(In reply to Michal Skrivanek from comment #4)
> (In reply to Arik from comment #3)
> > We can alternatively make rest-api imitate what the UI does when the
> > guaranteed memory is not specified through the API
> 
> you mean backend, right, as we're not putting any logic into the rest api
> layer.

Yes, I meant the rest-api modules on the backend side - where we set defaults for missing parts in requests that come from the API

Comment 6 Guilherme Santos 2021-06-29 17:30:27 UTC
Verified on:
ovirt-engine-4.4.7.5-0.9.el8ev.noarch

Steps:
1. Create a vm usign the API (tru rest, sdk or ansible for example):
# ansible localhost -c localhost -m ovirt.ovirt.ovirt_vm -a "name=vm_1 cluster=cluster_1 state=present auth='url=https://`hostname`/ovirt-engine/api username=admin@internal password=<pass> insecure=true' memory=4GiB"
2. Check the vm parameters in the UI

Results:
Guarantee memory automatically set accorded e

Comment 7 Guilherme Santos 2021-06-29 17:30:56 UTC
typo:
*... accorded to memory set

Comment 8 Sandro Bonazzola 2021-07-06 07:28:33 UTC
This bugzilla is included in oVirt 4.4.7 release, published on July 6th 2021.

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