Bug 2164431 - Default CPU request in namespace limitrange takes precedence over the VMs configured vCPU
Summary: Default CPU request in namespace limitrange takes precedence over the VMs con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.10.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: 4.10.8
Assignee: Igor Bezukh
QA Contact: Denys Shchedrivyi
URL:
Whiteboard:
Depends On: 2152534
Blocks: 2164432
TreeView+ depends on / blocked
 
Reported: 2023-01-25 14:23 UTC by Igor Bezukh
Modified: 2023-08-08 10:27 UTC (History)
5 users (show)

Fixed In Version: virt-operator-container-v4.10.8-9 hco-bundle-registry-container-v4.10.8-37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2152534
: 2164432 (view as bug list)
Environment:
Last Closed: 2023-08-08 10:27:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 9093 0 None open [release-0.49] [vmi-mutator-webhook]: do not inject LimitRange defaults into VMI 2023-01-25 14:24:56 UTC
Red Hat Issue Tracker CNV-24742 0 None None None 2023-01-25 14:25:14 UTC

Comment 1 zhe peng 2023-03-03 06:48:35 UTC
verify with build CNV-v4.10.8-37
step:
1. created LimitRange:
$cat limit.yaml
apiVersion: v1
kind: LimitRange
metadata:
  name: resource-limits
  namespace: default
spec:
  limits:
  - default:
      cpu: "2"
      memory: 4Gi
    defaultRequest:
      cpu: 100m
      memory: 4Gi
    max:
      cpu: "2"
      memory: 5Gi
    type: Container
2. created a vm with domain.cpu.cores is 10
oc get vm vm-fedora -o yaml 
...
cores: 10
sockets: 1
threads: 1

3: check vmi 
$ oc get vmi vm-fedora -o yaml
...
 cpu:
      cores: 10
      model: host-model
      sockets: 1
      threads: 1

...
  resources:
      requests:
        memory: 2Gi
...

4: check virt-launcher pod:
$ oc get pods virt-launcher-vm-fedora-spcsp -o yaml
requests:
        cpu: "1"
        devices.kubevirt.io/kvm: "1"
        devices.kubevirt.io/tun: "1"
        devices.kubevirt.io/vhost-net: "1"
        ephemeral-storage: 50M
        memory: 2437Mi

move to verified.


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