Bug 1081462
Summary: | [Intel 6.5.z Bug] virsh setvcpus can not setup correct vcpu number - rhev clone | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Jan Kurik <jkurik> |
Component: | qemu-kvm | Assignee: | Virtualization Maintenance <virt-maint> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.5 | CC: | acathrow, areis, armbru, bsarathy, chao.zhou, chayang, chegu_vinod, ctatman, dbayly, dyuan, ehabkost, gsun, honzhang, imammedo, jamorgan, jane.lv, jherrman, jiajun.xu, jkurik, joseph.szczypek, jshortt, juzhang, jvillalo, jwilleford, keve.a.gabbert, lersek, lisa.mitchell, lsu, michen, mkenneth, mrezanin, mtessun, nigel.croxon, pkrempa, pm-eus, qzhang, ruwang, tdosek, trinh.dao, virt-maint, will.auld, xfu, xiantao.zhang, xiaolong.wang |
Target Milestone: | rc | Keywords: | ZStream |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-rhev-0.12.1.2-2.415.el6_5.7 | Doc Type: | Bug Fix |
Doc Text: |
When hot unplugging a virtual CPU (vCPU) from a guest using libvirt, the current Red Hat Enterprise Linux QEMU implementation does not remove the corresponding vCPU thread. Because of this, libvirt previously did not correctly perceive the vCPU count after a vCPU had been hot unplugged. Consequently, an error occured in libvirt, which prevented increasing the vCPU count after the hot unplug. In this update, information from QEMU is used to filter out inactive vCPU threads of disabled vCPUs, and the internal checks now pass and allow the hot plug.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2014-04-03 14:01:01 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: | 1017858 | ||
Bug Blocks: |
Description
Jan Kurik
2014-03-27 11:53:07 UTC
As this bug was reproduced in bug 1017858#c12 already, so I just verify it this time on the latest qemu-kvm-rhev-0.12.1.2-2.415.el6_5.7. Host: kernel-2.6.32-431.11.2.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.415.el6_5.7.x86_64 seabios-0.6.1.2-28.el6.x86_64 Guest: kernel-2.6.32-431.el6.x86_64 Steps: 1. Boot up a guest with virt-manager with CPU maximum allocation 4 and current allocation is 2. [root@dell-per415-03 images]# ps ax | grep kvm 1151 ? S 0:00 [kvm-irqfd-clean] 20824 ? Sl 0:44 /usr/libexec/qemu-kvm -name rhel6 -S -M rhel6.5.0 -enable-kvm -m 2048 -realtime mlock=off -smp 2,maxcpus=4,sockets=4,cores=1,threads=1 -uuid 8299278b-f924-8c5b-0a2b-255abbdd356b -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/RHEL-Server-6.5-64-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23 -device virtio-net-pci,__com_redhat_macvtap_compat=on,netdev=hostnet0,id=net0,mac=52:54:00:0b:94:a6,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 2. virsh # list Id Name State ---------------------------------------------------- 3 rhel6 running virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":20830},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":20831}],"id":"libvirt-8"} 3. Plug another cpu and check it. virsh # setvcpus --live rhel6 3 virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":20830},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":20831},{"enabled-in-acpi":true,"current":false,"CPU":2,"pc":-2130449717,"halted":true,"thread_id":21049}],"id":"libvirt-12"} All the 3 vcpus "enabled-in-acpi" field is "true". 4. Plug the 4th cpu again and check it. virsh # setvcpus --live rhel6 4 virsh # virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":20830},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":20831},{"enabled-in-acpi":true,"current":false,"CPU":2,"pc":-2130449717,"halted":true,"thread_id":21049},{"enabled-in-acpi":true,"current":false,"CPU":3,"pc":-2130449717,"halted":true,"thread_id":21097}],"id":"libvirt-16"} All the 4 vcpus "enabled-in-acpi" field is "true". 5. Hot unplug 2 vcpu and check it. virsh # setvcpus --live rhel6 2 error: Operation not supported: qemu didn't unplug the vCPUs properly virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":20830},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":20831},{"enabled-in-acpi":false,"current":false,"CPU":2,"pc":-2130505407,"halted":true,"thread_id":21049},{"enabled-in-acpi":false,"current":false,"CPU":3,"pc":-2130505407,"halted":true,"thread_id":21097}],"id":"libvirt-22"} Now, the cpu 2 and cpu 3 "enabled-in-acpi" field is "false". Hi, Laszlo I'm testing with your test steps in bug 1017858#c29, so is this the expected result to verify this bug, right? Another question want to confirm with you, fix me if I should post this question to another guy:). From the current result, seems cpu hotunplug already works, why we still call it not supported? Maybe there's still some potential issues so it's not supported completely? Thanks, Qunfang (In reply to Qunfang Zhang from comment #5) > 5. Hot unplug 2 vcpu and check it. > > virsh # setvcpus --live rhel6 2 > error: Operation not supported: qemu didn't unplug the vCPUs properly > > virsh # > virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' > {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717, > "halted":true,"thread_id":20830},{"enabled-in-acpi":true,"current":false, > "CPU":1,"pc":-2130449717,"halted":true,"thread_id":20831},{"enabled-in-acpi": > false,"current":false,"CPU":2,"pc":-2130505407,"halted":true,"thread_id": > 21049},{"enabled-in-acpi":false,"current":false,"CPU":3,"pc":-2130505407, > "halted":true,"thread_id":21097}],"id":"libvirt-22"} > > Now, the cpu 2 and cpu 3 "enabled-in-acpi" field is "false". > > > Hi, Laszlo > > I'm testing with your test steps in bug 1017858#c29, so is this the expected > result to verify this bug, right? Yes, this is the expected result of the "query-cpus" QMP command. "virsh" reports the error because you didn't include the libvirt fix in your testing, so libvirt doesn't know to look for the "enabled-in-acpi". But, as far as qemu-kvm is concerned in isolation, the test is successful. > Another question want to confirm with you, fix me if I should post this > question to another guy:). From the current result, seems cpu hotunplug > already works, why we still call it not supported? Maybe there's still some > potential issues so it's not supported completely? If by "calling it not supported" you mean the error message from virsh, then please see above. For an end-to-end test, you need to upgrade both libvirt (so that it *consumes* the new field) and qemu-kvm (so that it *produces* the new field). Thanks Laszlo Thank you, Laszlo. I tested again with the latest rhel6.5-z libvirt-0.10.2-29.el6_5.7.x86_64 installed. Now when hot unplug vcpu, virsh does not report error any more. Test steps: Same as comment 10. Host version: kernel-2.6.32-431.7.1.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.415.el6_5.7.x86_64 libvirt-0.10.2-29.el6_5.7.x86_64 [root@localhost ~]# virsh list Id Name State ---------------------------------------------------- 1 rhel6 running [root@localhost ~]# [root@localhost ~]# virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":2499},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":2500}],"id":"libvirt-8"} virsh # virsh # virsh # setvcpus --live rhel6 3 virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":2499},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":2500},{"enabled-in-acpi":true,"current":false,"CPU":2,"pc":-2130449717,"halted":true,"thread_id":3205}],"id":"libvirt-12"} virsh # virsh # virsh # setvcpus --live rhel6 4 virsh # virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":2499},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":2500},{"enabled-in-acpi":true,"current":false,"CPU":2,"pc":-2130449717,"halted":true,"thread_id":3205},{"enabled-in-acpi":true,"current":false,"CPU":3,"pc":-2130449717,"halted":true,"thread_id":3348}],"id":"libvirt-16"} virsh # virsh # virsh # setvcpus --live rhel6 2 virsh # virsh # virsh # qemu-monitor-command rhel6 '{ "execute" : "query-cpus" }' {"return":[{"enabled-in-acpi":true,"current":true,"CPU":0,"pc":-2130449717,"halted":true,"thread_id":2499},{"enabled-in-acpi":true,"current":false,"CPU":1,"pc":-2130449717,"halted":true,"thread_id":2500},{"enabled-in-acpi":false,"current":false,"CPU":2,"pc":-2130505407,"halted":true,"thread_id":3205},{"enabled-in-acpi":false,"current":false,"CPU":3,"pc":-2130505407,"halted":true,"thread_id":3348}],"id":"libvirt-22"} virsh # 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. http://rhn.redhat.com/errata/RHBA-2014-0357.html |