Bug 1646369 - CPU count specified via spec.domain.resources.requests.cpu does not honour the value
Summary: CPU count specified via spec.domain.resources.requests.cpu does not honour th...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 1.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 1.4
Assignee: Martin Sivák
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-05 13:23 UTC by Kedar Bidarkar
Modified: 2019-02-26 13:24 UTC (History)
6 users (show)

Fixed In Version: 0.9.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-26 13:24:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
VMI Fedora28 cloud resources (964 bytes, text/plain)
2018-11-12 11:44 UTC, Kedar Bidarkar
no flags Details
output of vmi with -o yaml (2.51 KB, text/plain)
2018-11-12 12:22 UTC, Kedar Bidarkar
no flags Details
CPU resources requests limits works fine (9.62 KB, text/plain)
2019-01-14 14:28 UTC, Kedar Bidarkar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt issues 1602 0 None closed CPU count specified via spec.domain.resources.requests.cpu does not honour the value 2020-07-08 07:01:33 UTC
Red Hat Product Errata RHEA-2019:0417 0 None None None 2019-02-26 13:24:20 UTC

Description Kedar Bidarkar 2018-11-05 13:23:02 UTC
Description of problem:
Creating a VM with 2 cpus, gets created with only 1 cpu.

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

CNV-1.3

How reproducible:
When trying to create a VM with cpu-manager enabled as per the 2nd option, https://github.com/kubevirt/user-guide/blob/master/workloads/virtual-machines/dedicated-cpu.md#requesting-dedicated-cpu-resources

The below format does not result in 2 cpus.
I used this YAML format, which causes the issue.

apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstance
spec:
  domain:
    cpu:
      dedicatedCpuPlacement: true
    resources:
      limits:
        cpu: 2
        memory: 2Gi

Steps to Reproduce:
1. Create a VM with above vm spec.
2.
3.

Actual results:


Expected results:
Creation of the VM with 2 cpus, when checked vi nproc or cat /proc/cpuinfo.

Additional info:

I had enabled and configured my setup with cpu-manager feature-gates.

https://github.com/kubevirt/kubevirt/issues/1602

Comment 1 Kedar Bidarkar 2018-11-05 13:36:12 UTC
https://github.com/kubevirt/kubevirt/pull/1604 the fix from above kubevirt issue, seems to be this.

Comment 3 Vladik Romanovsky 2018-11-06 16:11:56 UTC
(In reply to Kedar Bidarkar from comment #1)
> https://github.com/kubevirt/kubevirt/pull/1604 the fix from above kubevirt
> issue, seems to be this.

Yep. This PR is already part of the release-0.9 branch.

Comment 5 Kedar Bidarkar 2018-11-12 11:44:44 UTC
Created attachment 1504671 [details]
VMI Fedora28 cloud resources

Tried by using the attached vm-spec file, but still see only 1 vcpu in the created VM.

[fedora@vmi-fedora28-cloud-res ~]$ cat /proc/cpuinfo | grep -i ^processor | wc -l
1
[fedora@vmi-fedora28-cloud-res ~]$

TESTED with CNV-1.3.0-11 /kubevirt-0.9.5

Comment 6 Fabian Deutsch 2018-11-12 12:13:21 UTC
Kedar, please provide `kubectl get -o yaml VMNAME` for the running VM.

Comment 7 Kedar Bidarkar 2018-11-12 12:22:27 UTC
Created attachment 1504681 [details]
output of vmi with -o yaml

Output via, "oc get vmi vmi-fedora28-cloud-res -o yaml"

Comment 8 Fabian Deutsch 2018-11-12 12:47:52 UTC
Can you please try:

apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstance
spec:
  domain:
    cpu:
      cores: 2
      dedicatedCpuPlacement: true
…

Without limits/requests.

Comment 10 Kedar Bidarkar 2018-11-26 11:26:37 UTC
Without limits and requests it does work fine.

Comment 11 Kedar Bidarkar 2018-11-26 11:27:40 UTC
spec.domain.cpu_cores approach  works fine as expected; but spec.domain.resources.requests.cpu   does not work and hence this bug.

Comment 12 Kedar Bidarkar 2019-01-14 14:27:49 UTC
I checked this with CNV-1.4 and it works fine now, I feel we can now move this to MODIFIED state. Will be attaching the results for the same shortly.

Comment 13 Kedar Bidarkar 2019-01-14 14:28:42 UTC
Created attachment 1520556 [details]
CPU resources requests limits works fine

Comment 15 Michal Skrivanek 2019-01-14 15:44:38 UTC
moving to Verified based on comment #13

Comment 18 errata-xmlrpc 2019-02-26 13:24:16 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, 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-2019:0417


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