Bug 2193083 - VM can't start because of requests/limits CPU number mismatch after adding the overallocated one
Summary: VM can't start because of requests/limits CPU number mismatch after adding th...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.12.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.12.3
Assignee: lpivarc
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks: 2196809
TreeView+ depends on / blocked
 
Reported: 2023-05-04 09:23 UTC by lpivarc
Modified: 2023-05-23 22:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-23 22:31:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 9697 0 None open [release-0.58] bug: fix the requests/limits CPU number mismatch for VMs with isolatedEmulatorThread 2023-05-04 09:23:55 UTC
Red Hat Issue Tracker CNV-28549 0 None None None 2023-05-04 09:26:20 UTC
Red Hat Product Errata RHEA-2023:3283 0 None None None 2023-05-23 22:31:37 UTC

Internal Links: 2196809

Description lpivarc 2023-05-04 09:23:56 UTC
This bug was initially created as a copy of Bug #2166512

I am copying this bug because: 
The bug was not resolved for 4.12.1 and it was resolved only in 4.13. Meaning users can hit this bug coming through 4.12.



Description of problem:
After the environment upgrading to OCP + CNV 4.12.1, the VMs with limits/requests resources specified can't start.

        memory:
          hugepages:
            pageSize: 1Gi
        resources:
          limits:
            cpu: "4"
            memory: 8Gi
          requests:
            cpu: "4"
            memory: 8Gi


Logs generated from virtualmachine-controller is as follows:

Error creating pod: Pod "virt-launcher-rhel8-ngu-2-5gmm4" is invalid: spec.containers[0].resources.requests: Invalid value: "5": must be less than or equal to cpu limit


The overhead(1 CPU) was added to the virt-launcher pod(4+1=5). However, it was only added to the requests while not to the limits, as we're getting denied by the validating webhook:

Error "spec.template.spec.domain.resources.requests.cpu or spec.template.spec.domain.resources.limits.cpu must be equal when DedicatedCPUPlacement is true " for field "spec.template.spec.domain.cpu.dedicatedCpuPlacement".


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


How reproducible:
100%

Steps to Reproduce:
1. Upgrade OCP + CNV env from version 4.11.* to 4.12.1.
2. Try to start a VM

Actual results:
The VM is always in 'starting' status, from the log, it's found the requests/limits CPU number mismatch after adding the overallocated cpu.


Expected results:
The overallocated CPU should be added to both requests and limits of the vmi pod
.
Additional info:

Comment 2 lpivarc 2023-05-11 07:48:43 UTC
Upstream backport was completed.

Comment 3 Akriti Gupta 2023-05-15 10:07:07 UTC
verified on v4.12.3-71

[akriti@fedora ~]$ oc get vmi
NAME      AGE    PHASE     IP            NODENAME                             READY
example   110s   Running   10.129.2.24   virt-akr-412b-5927q-worker-0-f97fl   True
[akriti@fedora ~]$ oc get vm example -o json | jq .spec.template.spec.domain.resources
{
  "limits": {
    "cpu": "4",
    "memory": "8Gi"
  },
  "requests": {
    "cpu": "4",
    "memory": "8Gi"
  }
}

VM has successfully started and running

Comment 9 errata-xmlrpc 2023-05-23 22:31:22 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 (OpenShift Virtualization 4.12.3 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/RHEA-2023:3283


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