Bug 2002313
| Summary: | Kubevirt doesn't respect cpuAllocationRatio | |||
|---|---|---|---|---|
| Product: | Container Native Virtualization (CNV) | Reporter: | Erkan Erol <eerol> | |
| Component: | Virtualization | Assignee: | Vladik Romanovsky <vromanso> | |
| Status: | CLOSED ERRATA | QA Contact: | Kedar Bidarkar <kbidarka> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 4.8.1 | CC: | cnv-qe-bugs, kbidarka, sgott, vromanso | |
| Target Milestone: | --- | |||
| Target Release: | 4.9.1 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | virt-operator-container-v4.9.1-4 hco-bundle-registry-container-v4.9.1-15 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2004950 (view as bug list) | Environment: | ||
| Last Closed: | 2021-12-13 19:59:01 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2004950 | |||
|
Description
Erkan Erol
2021-09-08 14:17:40 UTC
Tried to reproduce this:
a) Explicitly set the "cpuAllocationRatio" value via the JSON Annotation Patch.
]$ oc annotate --overwrite -n openshift-cnv hyperconverged kubevirt-hyperconverged kubevirt.kubevirt.io/jsonpatch='[{
"op": "add",
"path": "/spec/configuration/developerConfiguration/cpuAllocationRatio",
"value": 20
}]'
b) Value appears set correctly
]$ oc get kubevirt kubevirt-kubevirt-hyperconverged -n openshift-cnv -o yaml | grep -A 5 "configuration:"
configuration:
developerConfiguration:
cpuAllocationRatio: 20
diskVerification:
memoryLimit: 2G
featureGates:
c) I had set the "cores" count under "cpu" as 6
]$ oc get vmi vm22-rhel84-ocs -o yaml | grep -A 5 "cpu:"
cpu:
cores: 6
sockets: 1
threads: 1
---
d) virt-launcher pod shows "cpu: 100m"
]$ oc get pod virt-launcher-vm22-rhel84-ocs-sv46l -o yaml | grep "cpu:"
cpu: 100m
POD CPU request = number of vCPUs * 1/cpuAllocationRatio
Probably the expected value should have been 6/20 = 330m or 300m , IIUC
---
e)
Logged into the VM and checked for the nproc value. It is indeed 6.
[cloud-user@vm22-rhel84-ocs ~]$ nproc
6
I've posted https://github.com/kubevirt/kubevirt/pull/6374 to fix this. With the following:
[kbidarka@localhost ocs]$ oc get vmi vm-rhel84-ocs -o yaml | grep -A 5 "cpu:"
--
cpu:
cores: 6
sockets: 1
threads: 1
---
[kbidarka@localhost ocs]$ oc get pod virt-launcher-vm-rhel84-ocs-xkphg -o yaml | grep "cpu:"
f:cpu: {}
cpu: 300m
[kbidarka@localhost ocs]$ oc get kubevirt kubevirt-kubevirt-hyperconverged -n openshift-cnv -o yaml | grep -A 5 "configuration:"
--
configuration:
developerConfiguration:
cpuAllocationRatio: 20
diskVerification:
memoryLimit: 2G
featureGates:
---
With default value of "cpuAllocationRatio" as 10
[kbidarka@localhost ocs]$ oc get pod virt-launcher-vm-rhel84-ocs-g9kx7 -o yaml | grep "cpu:"
f:cpu: {}
cpu: 600m
---
VERIFIED with virt-operator-container-v4.9.1-4
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 (OpenShift Virtualization 4.9.1 Images), 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/RHBA-2021:5091 |