Bug 2104430 - Add note about how ResourceQuotas work with VMs
Summary: Add note about how ResourceQuotas work with VMs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Documentation
Version: 4.11.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.11.1
Assignee: Bob Gaydos
QA Contact: Oded Ramraz
URL:
Whiteboard: Add to 4.11 post-feature work
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-06 09:00 UTC by Fabian Deutsch
Modified: 2022-10-06 17:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-06 17:44:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-19689 0 None None None 2022-07-12 19:35:04 UTC

Internal Links: 1965724

Description Fabian Deutsch 2022-07-06 09:00:10 UTC
Document URL: https://docs.openshift.com/container-platform/4.10/virt/virtual_machines/advanced_vm_management/virt-specifying-nodes-for-vms.html

Section Number and Name: "Advanced Virtual Machine management"

Describe the issue: ResourceQuotas do work with VMs, but they have functional limits. 
Specifically ResourceQuotas do not work with VMs out-of-the-box if the ResourceQUota has quota set for requests AND limits, that is because resources limits are not set on VMs by default.

Suggestions for improvement: We need to cover 2 things
1. Tell that VMs work out-of-the-box with ResourceQuotas if the RQ has a quota set of requests _only_.
2. VMs will not work out-of-the-box with a ResourceQuota if the RQ has set both requests and limits OR limits only. For this to work, some mechanism or human has to set resource limits on the VM. In future this is planned to be automatic, but currently this is manual

Additional information:

Comment 3 Bob Gaydos 2022-07-18 14:41:23 UTC
Thanks @ctomasko. No problem.

Comment 4 Bob Gaydos 2022-07-25 18:59:32 UTC
Hi @fdeutsch -

This one's a little hard for me to understand as it's been worded. Here's what I was able to do:

[NOTE]
====
You can only set `ResourceQuotas` for virtual machines if the resource quota has a set of requests. If the resource quota contains both requests and limits, the request limits on the virtual machine must be set.
====

If these terms aren't accurate, let's get together and maybe you can explain it so I can word it minimalistically.

Thanks
Bob

Comment 5 Bob Gaydos 2022-07-25 19:04:21 UTC
PR: https://github.com/openshift/openshift-docs/pull/48252

Comment 7 Bob Gaydos 2022-07-25 19:50:37 UTC
Fabian recommended:

By default OpenShift Virtualization is setting CPU and memory requests on a VM, but not CPU and memory limits.
Due to this you can only set requests in ResourceQuotas by default.
In order to leverage requests and limits in ResourceQuota you will have to manually assign CPU and/or memory limits to a VM. Once this is done, a ResourceQuota with both requests and limits can be applied to namespaces containing VMs.

I'll rephrase based on this for the next round.

Comment 8 Dan Kenigsberg 2022-07-26 06:05:29 UTC
I think that the following text would be more helpful to a VM owner. I suggest to drop the initial "By default " because it suggests there's a method to change the default (which we do not have). I also suggest make the text suited for the VM owner persona who has cannot make any change to the ResourceQuota imposed on them by their cluster-admin. Lastly, I think we should provide an example of a vm yaml with limits and guide how the limit should be set (150% of the request?).

"""
OpenShift Virtualization is setting CPU and memory requests on a VM, but not CPU and memory limits.
This works well if your ResourceQuota uses only requests. However if your ResourceQuota has limits, too, you have to manually assign CPU and/or memory limits to a VM as shown in this YAML example...
"""

Comment 9 Bob Gaydos 2022-07-26 14:31:16 UTC
Thanks @@danken - 

@fdeutsch - Can you provide a YAML example to illustrate Dan's text? Thanks,

Bob

Comment 10 Fabian Deutsch 2022-07-29 16:12:25 UTC
Here you go

```
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: with-limits
spec:
  running: false
  template:
    spec:
      domain:
        …
        resources:
          requests:
            memory: 128Mi
          limits:
            memory: 256Mi  # Should at least be 100Mi larger than requests
```

Comment 12 sgott 2022-07-29 17:23:58 UTC
I will review https://github.com/openshift/openshift-docs/pull/48252 as soon as the example from Comment #10 is incorporated.

Comment 13 Bob Gaydos 2022-08-05 16:05:35 UTC
Thanks @sgott and @fdeutsch -

PR: https://github.com/openshift/openshift-docs/pull/48252

Direct doc preview link: http://file.rdu.redhat.com/bgaydos/CNV-19689/virt/virtual_machines/advanced_vm_management/virt-specifying-nodes-for-vms.html

Can you recommend a QE? 

Bob

Comment 14 Bob Gaydos 2022-09-21 23:24:46 UTC
Revised PR: https://github.com/openshift/openshift-docs/pull/48252 with a couple final questions for @pousley

Comment 15 Bob Gaydos 2022-10-06 17:44:21 UTC
DONE: https://github.com/openshift/openshift-docs/pull/48252


Note You need to log in before you can comment on or make changes to this bug.