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: CLOSED ERRATA QA Contact: zhe peng <zpeng>
Severity: high Docs Contact:
Priority: high    
Version: futureCC: dholler, gouyang, tnisan, ycui, zpeng
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubevirt-ssp-operator-rhel9-container-v4.14.0-107 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:05:04 UTC 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.

Comment 5 zhe peng 2023-09-13 07:37:53 UTC
verify with build: CNV-v4.14.0.rhel9-1912

step:
1. Define a VM with 4 GB memory from GUI
2. start vm and check VMI
...
memory:
        guest: 4Gi
...

Comment 8 errata-xmlrpc 2023-11-08 14:05:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Virtualization 4.14.0 Images security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6817