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.
Bug 1035108 - Implement the error message while plug more CPUs than set in "current" using the guest agent
Summary: Implement the error message while plug more CPUs than set in "current" using ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1035109
TreeView+ depends on / blocked
 
Reported: 2013-11-27 05:48 UTC by zhenfeng wang
Modified: 2014-06-18 00:59 UTC (History)
11 users (show)

Fixed In Version: libvirt-1.1.1-14.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1035109 (view as bug list)
Environment:
Last Closed: 2014-06-13 12:07:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhenfeng wang 2013-11-27 05:48:52 UTC
Description of problem:
Implement the error message while plug more CPUs than set in "current" using the guest agent

Version-Release number of selected component (if applicable):
 qemu-kvm-rhev-1.5.3-19.el7.x86_64
 libvirt-1.1.1-13.el7.x86_64
 kernel-3.10.0-47.el7.x86_6
 qemu-guest-agent-1.5.3-19.el7.x86_64.rpm

How reproducible:
100%

Steps
1.Prepare a running guest with qemu-ga service installed
# virsh list
 Id    Name                           State
----------------------------------------------------
 32    rhel7                          running

# virsh dumpxml rhel7 |grep cpu -A 3
  <vcpu placement='static' current='1'>3</vcpu>

2. Start the qemu-guest-agent service in the guest
#systemctl start qemu-guest-agent

3. Do cpu hotpulug and plug more CPUs than set in "current" using the guest agent, it report an unclear error

# virsh setvcpus rhel7 --guest 2
error: internal error: guest agent reports less cpu than requested

# virsh vcpucount rhel7 --guest
1

4.Both rhel6 and rhel7 have the same result with step3   

Actual results:
Didn't report an clear error while plug more CPUs than set in "current" using the guest agent
Expected results:
Should report an clear error message

Comment 2 Peter Krempa 2013-12-06 10:16:07 UTC
Fixed upstream:

commit 34b8449027adc44bd38151f384f5a5cdd64d996f
Author: Peter Krempa <pkrempa>
Date:   Thu Dec 5 17:47:14 2013 +0100

    qemu: Improve error when setting invalid count of vcpus via agent
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1035108
    
    When attempting to enable more vCPUs in the guest than is currently
    enabled in the guest but less than the maximum count for the VM we
    currently reported an unhelpful message:
    
     error: internal error: guest agent reports less cpu than requested
    
    This patch changes it to:
    
     error: invalid argument: requested vcpu count is greater than the count
     of enabled vcpus in the domain: 3 > 2

Comment 5 Hao Liu 2013-12-09 08:23:59 UTC
This bug is VERIFIED.

Verification steps:
Same as https://bugzilla.redhat.com/show_bug.cgi?id=1035108#c0

When calling:
# setvcpus rhel7 --guest 2

Results for libvirt-1.1.1-13.el7:
error: internal error: guest agent reports less cpu than requested

Results for libvirt-1.1.1-14.el7:
error: invalid argument: requested vcpu count is greater than the count of enabled vcpus in the domain: 2 > 1

So this patch is verified to fix the unhelpful message.

Comment 6 chao.zhou 2013-12-27 07:27:09 UTC
Hi, after hotadd the vcpu,
# virsh setvcpus rhel7 --guest 2
error: internal error: guest agent reports less cpu than requested

# virsh vcpucount rhel7 --guest
1

why vcpucount still report guest has 1 vcpu? should it be 3?

Comment 7 dyuan 2013-12-27 07:47:06 UTC
(In reply to chao.zhou from comment #6)
> Hi, after hotadd the vcpu,
> # virsh setvcpus rhel7 --guest 2
> error: internal error: guest agent reports less cpu than requested
> 
> # virsh vcpucount rhel7 --guest
> 1
> 
> why vcpucount still report guest has 1 vcpu? should it be 3?

http://www.libvirt.org/formatdomain.html#elementsCPUAllocation
the optional attribute current can be used to specify whether fewer than the maximum number of virtual CPUs should be enabled.

Comment 8 chao.zhou 2013-12-27 13:09:37 UTC
(In reply to dyuan from comment #7)
> (In reply to chao.zhou from comment #6)
> Hi, after hotadd the vcpu,
> #
> virsh setvcpus rhel7 --guest 2
> error: internal error: guest agent reports
> less cpu than requested
> 
> # virsh vcpucount rhel7 --guest
> 1
> 
> why
> vcpucount still report guest has 1 vcpu? should it be 3?
> http://www.libvirt.org/formatdomain.html#elementsCPUAllocation
the optional
> attribute current can be used to specify whether fewer than the maximum
> number of virtual CPUs should be enabled.

# virsh dumpxml rhel7 |grep cpu -A 3
  <vcpu placement='static' current='1'>3</vcpu>

This means the maximum number of vCPUs is 3, and the guest boots up with 1 online vCPU.

# virsh setvcpus rhel7 --guest 2

This means to set the vCPU number to 2 which is less than the maximum number 3. But why the vcpucount number is still 1? Is hot-add vCPU is not supported? 
Please correct me if I'm thinking the wrong way. 

Thanks.

Comment 9 zhenfeng wang 2013-12-30 02:02:11 UTC
(In reply to chao.zhou from comment #8)
> (In reply to dyuan from comment #7)
> > (In reply to chao.zhou from comment #6)
> > Hi, after hotadd the vcpu,
> > #
> > virsh setvcpus rhel7 --guest 2
> > error: internal error: guest agent reports
> > less cpu than requested
> > 
> > # virsh vcpucount rhel7 --guest
> > 1
> > 
> > why
> > vcpucount still report guest has 1 vcpu? should it be 3?
> > http://www.libvirt.org/formatdomain.html#elementsCPUAllocation
> the optional
> > attribute current can be used to specify whether fewer than the maximum
> > number of virtual CPUs should be enabled.
> 
> # virsh dumpxml rhel7 |grep cpu -A 3
>   <vcpu placement='static' current='1'>3</vcpu>
> 
> This means the maximum number of vCPUs is 3, and the guest boots up with 1
> online vCPU.
> 
> # virsh setvcpus rhel7 --guest 2
> 
> This means to set the vCPU number to 2 which is less than the maximum number
> 3. But why the vcpucount number is still 1? Is hot-add vCPU is not
> supported? 
> Please correct me if I'm thinking the wrong way. 
> 
> Thanks.

The virsh setvcpus --guest command only change the cpu numbers in the guest instead of the the hypervisor, you can find it via in virsh man page, so the cpu numbers in the guest's xml wasn't changed. In fact, you can check it with the following method 
1.login the guest ,check the guest's cpu with
 #cat /proc/cpuinfo command
2.check the cpu numbers with the virsh command in the host
#virsh vcpucount $guest_name --guest

Comment 10 Ludek Smid 2014-06-13 12:07:50 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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