Bug 1982296 - vCPU maximum CPU calculation is off causing VM's not to boot due to exceeding maximum vcpu of machine type
Summary: vCPU maximum CPU calculation is off causing VM's not to boot due to exceeding...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.4.8
: 4.4.8
Assignee: Milan Zamazal
QA Contact: Polina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-14 16:06 UTC by amashah
Modified: 2024-10-01 18:59 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.4.8.2
Doc Type: Bug Fix
Doc Text:
Previously, it was possible to set the maximum number of vCPUs too high for virtual machine with the i4440fx BIOS type with certain CPU topologies. This prevented those virtual machines from starting. The current release fixes this issue and the maximum number of vCPUs for such virtual machines is now set within a valid range.
Clone Of:
Environment:
Last Closed: 2021-09-08 14:12:04 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 6184081 0 None None None 2021-07-14 16:11:14 UTC
Red Hat Product Errata RHBA-2021:3460 0 None None None 2021-09-08 14:12:16 UTC
oVirt gerrit 115917 0 master MERGED core: Limit the number of i440fx VCPUs to 240 2021-07-28 16:24:06 UTC

Description amashah 2021-07-14 16:06:26 UTC
Description of problem:
When trying to start a VM with vCPU count of 31 with a single socket and thread causes the maximum vCPU calculation to be more than the maximum supported by the machine type.

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

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with total vCPU count = 31 (1 socket, 31 cores per vsocket, 1 thread per core)
2. Try to start the VM
3. It fails with: 
VM <vm-name> is down with error. Exit message: unsupported configuration: Maximum CPUs greater than specified machine type limit 240.


Actual results:
VM fails to start

Expected results:
VM starts

Additional info:

There is some issue with how maximum vCPU is calculated.

Here are some examples:


30 vCPU (1 socket, 30 cores, 1 thread) 1:30:1

[root@dell-r430-02 ~]# virsh -r vcpucount amashah-vcputest
maximum      config       240
maximum      live         240
current      config        30
current      live          30



32 vCPU (8:4:1)
[root@dell-r430-02 ~]# virsh -r vcpucount amashah-vcputest
maximum      config        64
maximum      live          64
current      config        32
current      live          32



32 (8:2:2)
[root@dell-r430-02 ~]# virsh -r vcpucount amashah-vcputest
maximum      config       240
maximum      live         240
current      config        32
current      live          32




With 31 (1:31:1) it fails to start, but the XML is created with 248 (max of machine type is 240).

  <vcpu current="31">248</vcpu>



There seems to be an issue with the maximum CPU calculation as you can see above.

I would also expect that 32 vCPU (8:2:2) vs  32 vCPU (8:4:1) have the same max count, but they do not.

Comment 2 Arik 2021-07-18 16:35:27 UTC
There are no logs attached to this case but it's most probably a VM that is set with an i440fx chipset:

[root@ocelot03 ~]# virsh qemu-monitor-command 2 '{"execute":"query-machines"}' 
{"return":[{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.0.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":false,"name":"none","numa-mem-supported":false,"cpu-max":1,"deprecated":false,"default-ram-id":"ram"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.5.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.3.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel8.3.0","numa-mem-supported":false,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel7.6.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.1.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel8.1.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel7.4.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.6.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","is-default":true,"cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram","alias":"pc"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel8.4.0","numa-mem-supported":false,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram","alias":"q35"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.4.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel8.2.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel7.5.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-i440fx-rhel7.2.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":240,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel8.0.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":710,"deprecated":false,"default-ram-id":"pc.ram"},{"hotpluggable-cpus":true,"name":"pc-q35-rhel7.3.0","numa-mem-supported":true,"default-cpu-type":"qemu64-x86_64-cpu","cpu-max":255,"deprecated":false,"default-ram-id":"pc.ram"}],"id":"libvirt-72651"}

We have increased the limit from 240 to 288 in 4.1 [1] and now even higher, without taking into account that the limit for i440fx remains 240.
A workaround for this issue would be to use q35 instead.

[1] https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-4.2/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql#L387-L389

Comment 3 Milan Zamazal 2021-07-26 10:01:43 UTC
Indeed, it seems the limit for i440fx is 240 rather than the currently assumed 255. I'll fix it in my current max vCPUs patch series.

Comment 7 Polina 2021-08-22 09:36:09 UTC
verified on  ovirt-engine-4.4.8.4-0.7.el8ev.noarch
host topology:

[root@intel-knm-03 ~]# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              288
On-line CPU(s) list: 0-287
Thread(s) per core:  4
Core(s) per socket:  72
Socket(s):           1
NUMA node(s):        2

VM with type I440FX and Q35 Chipset successfully starts with topology:
cores per socket 31, virtual socket 1, threads per core 1

for VM I440FX: # virsh -r vcpucount 3
maximum      config       217
maximum      live         217
current      config        31
current      live          31

for VM Q35 (the same topology) 

virsh -r vcpucount 4
maximum      config       496
maximum      live         496
current      config        31
current      live          31

Comment 12 errata-xmlrpc 2021-09-08 14:12:04 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 (RHV Manager (ovirt-engine) [ovirt-4.4.8]), 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:3460


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