Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
In the output of 'query-machines', qemu reports that 255 vcpus are supported in the cpu-max field, even though the maximum is 160.
+++ This bug was initially created as a clone of Bug #1092363 +++
Description:
Virsh cmd maxvcpus returns 255 for kvm type, but the maximum number of vcpus supported by kvm is 160
Product Version:
libvirt-1.1.1-29.el7.x86_64
How producible:
Always
Steps:
1. Edit the domain with 255 vcpus
# virsh edit test-queues
change the vcpu to 255 like <vcpu placement='static'>255</vcpu>
Domain test-queues XML configuration edited.
# virsh dumpxml test-queues | grep domain
<domain type='kvm'>
# virsh dumpxml test-queues | grep vcpu
<vcpu placement='static'>255</vcpu>
2. Start domain
# virsh start test-queues
error: Failed to start domain test-queues
error: internal error: process exited while connecting to monitor: Warning: Number of SMP cpus requested (255) exceeds the recommended cpus supported by KVM (160)
Number of SMP cpus requested (255) exceeds the maximum cpus supported by KVM (160)
3. # virsh maxvcpus kvm
255
Actual Results:
As above shows
Expected Results:
In step 2, it is said that the maximum cpus supported by KVM (160). However, in step 3, the maxvcpus cpus for kvm printed by virsh is 255.
If the number of vcpu is larger than 160, domain can not be started, so the result of step 3 should be modified to 160.
--- Additional comment from Hu Jianwei on 2014-07-23 11:25:08 CEST ---
virsh capabilities also can hit this issue.
[root@localhost ~]# virsh capabilities
<capabilities>
<host>
<uuid>00c1fcdb-9fd8-e111-852c-24be051881ce</uuid>
...(clipped)
<guest>
<os_type>hvm</os_type>
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/libexec/qemu-kvm</emulator>
<machine canonical='pc-i440fx-rhel7.0.0' maxCpus='255'>pc</machine>
<machine canonical='pc-q35-rhel7.0.0' maxCpus='255'>q35</machine>
<machine maxCpus='255'>rhel6.0.0</machine>
<machine maxCpus='255'>rhel6.1.0</machine>
<machine maxCpus='255'>rhel6.2.0</machine>
<machine maxCpus='255'>rhel6.3.0</machine>
<machine maxCpus='255'>rhel6.4.0</machine>
<machine maxCpus='255'>rhel6.5.0</machine>
<machine maxCpus='1'>none</machine>
<domain type='qemu'>
</domain>
<domain type='kvm'>
<emulator>/usr/libexec/qemu-kvm</emulator>
</domain>
</arch>
<features>
<cpuselection/>
<deviceboot/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
<pae/>
<nonpae/>
</features>
</guest>
<guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/libexec/qemu-kvm</emulator>
<machine canonical='pc-i440fx-rhel7.0.0' maxCpus='255'>pc</machine>
<machine canonical='pc-q35-rhel7.0.0' maxCpus='255'>q35</machine>
<machine maxCpus='255'>rhel6.0.0</machine>
<machine maxCpus='255'>rhel6.1.0</machine>
<machine maxCpus='255'>rhel6.2.0</machine>
<machine maxCpus='255'>rhel6.3.0</machine>
<machine maxCpus='255'>rhel6.4.0</machine>
<machine maxCpus='255'>rhel6.5.0</machine>
<machine maxCpus='1'>none</machine>
<domain type='qemu'>
</domain>
<domain type='kvm'>
<emulator>/usr/libexec/qemu-kvm</emulator>
</domain>
</arch>
<features>
<cpuselection/>
<deviceboot/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
</features>
</guest>
</capabilities>
--- Additional comment from Jan Tomko on 2014-07-25 15:13:52 CEST ---
For 'virsh maxvcpus', libvirt gets the maximum from the kernel:
#ifdef KVM_CAP_MAX_VCPUS
/* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */
if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0)
goto cleanup;
#endif /* KVM_CAP_MAX_VCPUS */
/* as a fallback get KVM_CAP_NR_VCPUS (the recommended maximum number of
* vcpus). Note that on most machines this is set to 160. */
if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS)) > 0)
goto cleanup;
Upstream QEMU only reports a warning when the VCPU number exceeds the recommended number (CAP_NR_VCPUS), but QEMU in RHEL-7.0 treats the recommended number as a maximum.
A RHEL-only patch for libvirt reporting only the NR_VCPUS value will be needed.
The maxCpus values in 'virsh capabilites' come directly from QEMU's 'query-machines' command.
qemu-kvm-1.5.3-66.el7+ reports 160, some future one will do 240. (patches posted)
Before that, we had 255 because the machine type supports it, only KVM does not. The limit got lower because of TCG, so it is synchronized with CAP_NR_VCPUS now, but they aren't related.