Bug 2148837

Summary: Limits are not changed/no options to change the limits while increasing/decreasing the virtual machine resources from GUI
Product: Container Native Virtualization (CNV) Reporter: nijin ashok <nashok>
Component: User ExperienceAssignee: Tal Nisan <tnisan>
Status: CLOSED MIGRATED QA Contact: Guohua Ouyang <gouyang>
Severity: high Docs Contact:
Priority: high    
Version: 4.11.0CC: acardace, fdeutsch, gouyang, rsdeor, tnisan, ycui
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-22 11:13:58 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 nijin ashok 2022-11-28 06:07:24 UTC
Description of problem:

[1] Created a VM with below resources.limit.memory and resources.requests.memory.

~~~
# oc get vm rhel7-forward-rook -o yaml |yq -y '.spec.template.spec.domain.resources'
limits:
  memory: 5Gi
requests:
  memory: 4Gi
~~~

The namespace has got Max Limit/Request Ratio for memory set to 2.

~~~
# oc describe limits
Name:       resource-limits
Namespace:  nijin-cnv
Type        Resource  Min  Max  Default Request  Default Limit  Max Limit/Request Ratio
----        --------  ---  ---  ---------------  -------------  -----------------------
Container   cpu       -    2    2                2              -
Container   memory    -    8Gi  4Gi              4Gi            2                          <<<
~~~

[2] Increased the VM memory to 5 Gi from the web UI. 

~~~
Click on VM => Details => Edit CPU | Memory
~~~

This only increased the requests and not the limits.

~~~
# oc get vm rhel7-forward-rook -o yaml|yq -y '.spec.template.spec.domain.resources'
limits:
  memory: 5Gi
requests:
  memory: 5Gi
~~~

VM will start since the ratio is 1 less than maxLimitRequestRatio.


[3] Decreased the VM memory to 2 Gi from web UI and now, the VM startup fails with the error below because the ratio is more than 2:

~~~
Click on VM => Details => Edit CPU | Memory
~~~


~~~
5s          Warning   FailedCreate                 virtualmachineinstance/rhel7-forward-rook              (combined from similar events): Error creating pod: pods "virt-launcher-rhel7-forward-rook-f78gg" is forbidden: memory max limit to request ratio per Container is 2, but provided ratio is 2.342071
~~~

In [2] and [3], there is no option to mention the limits. Also, it doesn't increase the limits automatically in proportion to the increase in requests.


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

OpenShift Virtualization   4.11.0


How reproducible:

100%

Steps to Reproduce:

Please refer above.

Actual results:

Limits are not changed/no options to change the  limits while increasing/decreasing the virtual machine resources from GUI

Expected results:

The customer is expecting to decrease/increase the limits in proportion to the increase/decrease of the requests.


Additional info:

Comment 5 Kedar Bidarkar 2023-06-14 12:48:42 UTC
As the Epic mentioned in Comment1 is closed, https://issues.redhat.com/browse/CNV-19156

GUI QE, could test this and see if this is fixed.

Comment 6 Guohua Ouyang 2023-07-17 03:39:55 UTC
(In reply to Kedar Bidarkar from comment #5)
> As the Epic mentioned in Comment1 is closed,
> https://issues.redhat.com/browse/CNV-19156
> 
> GUI QE, could test this and see if this is fixed.

I could still reproduce the issue on CNV-v4.14.0.rhel9-1219, I don't see any UI work is done, so assign the bug back for further investigation.

Comment 7 Guohua Ouyang 2023-07-17 11:32:39 UTC
It seems nothing can be done from UI, since the bug is still reproducible, move the bug back to virt for further investigation.
Don't know what's has been done in the backend, is it something can be verified?

Comment 8 Antonio Cardace 2023-07-31 12:34:48 UTC
Hi @nashok, the backend won't resize the VM limit by design, it's up to you to decide requests and limits for the VM especially because it cannot be aware of ratio requirements like in this case.

This definitely looks like a UI RFE to expose limits as well, changing bz component for them to assess the bug.

Comment 9 Red Hat Bugzilla 2023-12-21 04:25:11 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days