Bug 2174892

Summary: GUI should set VM memory to guest memory instead of memory requests
Product: Container Native Virtualization (CNV) Reporter: Itamar Holder <iholder>
Component: SSPAssignee: Karel Šimon <ksimon>
Status: NEW --- QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: futureCC: dholler, gouyang, tnisan, ycui
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Itamar Holder 2023-03-02 14:48:55 UTC
Description of problem:
Currently when choosing memory amount in the GUI console, the memory is applied to `vmi.spec.domain.resources.requests[memory]`.

This field is NOT meant to reflect the amount of memory allocated to the guest, but instead the amount of memory allocated to the virt-launcher pod (which includes virtualization infrastructure overhead in addition to the guest memory).

When users set a memory amount for VMs/VMIs, they mean to set `vmi.spec.domain.memory.guest`, which specifies the amount of memory the guest could use.

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


How reproducible:
100%

Steps to Reproduce:
1. Define a VM with certain amount of memory
2. See that for this vmi `vmi.spec.domain.resources.requests[memory]` is being set with the specified amount.
3.

Actual results:
When defining a VMI with a memory amount, `vmi.spec.domain.resources.requests[memory]` field is being set.

Expected results:
When defining a VMI with a memory amount, `vmi.spec.domain.memory.guest` should be set.
`vmi.spec.domain.resources.requests[memory]` should stay empty unless the user had explicitly asked to populate it.

Comment 1 Matan Schatzman 2023-03-06 07:31:46 UTC
Hey @iholder 

Currently, our common templates still contain request.memory , I can adjust our editors and wizard to add the user adjustments of memory to memory.guest, but in the final VM/VMI object, the memory will appear in both request.memory and memory.guest - is this the desired result? imho I think our common templates should be updated to the memory.guest?

Comment 2 Itamar Holder 2023-03-08 10:30:32 UTC
Hey @mschatzm,

Thanks for bringing it into attention.
Eventually, VMs/VMIs should *only* have the guest memory field populated, unless the user explicitly populates requests[memory] field on rare cases.

So yes, our templates need to be updated so the memory request is not populated by default.

Comment 3 Guohua Ouyang 2023-08-01 05:28:36 UTC
Move the bug to SSP for updating the common templates.

Comment 4 Dominik Holler 2023-08-02 15:19:08 UTC
It would be helpful to verify this bug on a cluster with quotas enabled.