Bug 644736

Summary: virt-manager can not change vcpus for KVM guest
Product: Red Hat Enterprise Linux 5 Reporter: Johnny Liu <jialiu>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.6CC: ajia, dallan, dyuan, hjiang, jkachuck, llim, mliu, mzhan, xen-maint, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 11:21:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 684940    

Description Johnny Liu 2010-10-20 06:13:27 UTC
Description of problem:
In virt-manager GUI, try to change vcpu, but the change can not be saved.

Version-Release number of selected component (if applicable):
virt-manager-0.6.1-13.el5
libvirt-0.8.2-7.el5
# uname -a
Linux localhost.localdomain 2.6.18-227.el5 #1 SMP Tue Oct 12 18:50:50 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:
Always

Steps to Reproduce:
1. Launch virt-manager GUI.
2. Select a VM, and go to Hardware Tab.
3. Change CPUs allocation value, click Apply.
  
Actual results:
Change can not be saved. And there is no any error message.

In .virt-manager/virt-manager.log:
...
[Wed, 20 Oct 2010 01:48:10 virt-manager 4438] INFO (details:1420) Setting vcpus for 6c143a7c-150f-dc29-224c-940672cbea1d to 1.0
[Wed, 20 Oct 2010 01:48:10 virt-manager 4438] ERROR (virt-manager:156) Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 1421, in config_vcpus_apply
    self.vm.set_vcpu_count(vcpus)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1263, in set_vcpu_count
    self.vm.setVcpus(vcpus)
  File "/usr/lib64/python2.4/site-packages/libvirt.py", line 651, in setVcpus
    if ret == -1: raise libvirtError ('virDomainSetVcpus() failed', dom=self)
libvirtError: Requested operation is not valid: domain is not running
None

Seen from log, virt-manager is calling virDomainSetVcpus, this function is indeed invalid for an inactive domain.

But for user, to change VCPUs is a very normal operation. 

I also did the same operation on RHEL6, it works fine.

Expected results:
User should be able to change VCPUs.

Additional info:
Via virsh edit <guestname>, user can change VCPUs successfully.

Comment 2 RHEL Program Management 2010-12-07 10:33:34 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.6 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Comment 5 IBM Bug Proxy 2011-03-26 16:41:21 UTC
------- Comment From pradeepkumars.com 2011-02-21 02:37 EDT-------
any updates?

--pradeep

------- Comment From pradeepkumars.com 2011-02-22 00:12 EDT-------
(In reply to comment #13)
> Hello,
> In the summery you noted Red hat engineering was aware of this issue. I am not
> quickly finding this BZ.
> Do you have the BZ for this issue?
>
> Thank You
> Joe Kachuck

https://bugzilla.redhat.com/show_bug.cgi?id=644736
https://bugzilla.redhat.com/show_bug.cgi?id=645285
https://bugzilla.redhat.com/show_bug.cgi?id=638065

Comment 6 Cole Robinson 2011-04-29 14:19:54 UTC
Sorry for not replying earlier, this is now fixed in virt-manager-0.6.1-14.el5, so should hit 5.7

Comment 8 Huming Jiang 2011-05-05 07:42:10 UTC
Reproduce:
virt-manager-0.6.1-13.el5
libvirt-0.8.2-18.el5

Verfied it on build :
virt-manager-0.6.1-14.el5
libvirt-0.8.2-18.el5

Steps:
1. Launch virt-manager GUI.
2. Select a VM, and go to Hardware Tab.
3. Change CPUs allocation value, click Apply.
4. The result has been changed.

Comment 9 errata-xmlrpc 2011-07-21 11:21:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1055.html