Bug 840789

Summary: The "CPU time" information has been lost except first section while use command "virsh vcpuinfo <guest>".
Product: Red Hat Enterprise Linux 6 Reporter: lei wang <leiwan>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, dallan, dyasny, dyuan, gsun, mzhan, rwu, whuang, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-19 14:36:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description lei wang 2012-07-17 08:40:57 UTC
Description of problem:
The "CPU time" information has been lost except first section while use command "virsh vcpuinfo <guest>".

Version-Release number of selected component (if applicable):
# rpm -qa |grep libvirt
libvirt-client-0.9.13-2.el6.x86_64
libvirt-0.9.13-2.el6.x86_64
libvirt-python-0.9.13-2.el6.x86_64
libvirt-docs-0.9.13-2.el6.x86_64
libvirt-daemon-0.9.13-2.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1, Install a new vm in a numa box. In the xml description of the vm, we could specify the physical cpuset using "cpuset"attribute of vcpu element. xml as follows:

...
  <vcpu cpuset='0'>3</vcpu>
...

2, then, output the vcpu information on the vm, we can see that all of the vcpu are pinned into the first physical cpu.

# virsh vcpuinfo migratetest

  
Actual results:
The "CPU time" information has been lost except first section.

# virsh vcpuinfo rhel6u3
VCPU:           0
CPU:            0
State:          running
CPU time:       0.7s
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------

VCPU:           2
CPU:            0
State:          running
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------


Expected results:
The "CpPU time" could display on every section
# virsh vcpuinfo migratetest
VCPU:           0
CPU:            0
State:          running
CPU time:       85.7s
CPU Affinity:   y-

VCPU:           1
CPU:            0
State:          running
CPU time:       111.0s
CPU Affinity:   y-

VCPU:           2
CPU:            0
State:          running
CPU time:       109.8s
CPU Affinity:   y-

Additional info:
This issue is not reproduce on build libvirt-0.9.10-21.el6_3.1.x86_64.
# rpm -qa |grep libvirt
libvirt-client-0.9.10-21.el6_3.1.x86_64
libvirt-0.9.10-21.el6_3.1.x86_64
libvirt-python-0.9.10-21.el6_3.1.x86_64
# virsh edit rhel6
Domain rhel6 XML configuration not changed.

# virsh list
 Id    Name                           State
----------------------------------------------------
 2     rhel6                          running

# virsh vcpuinfo rhel6
VCPU:           0
CPU:            0
State:          running
CPU time:       15.9s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU time:       10.4s
CPU Affinity:   y-------

VCPU:           2
CPU:            0
State:          running
CPU time:       10.5s
CPU Affinity:   y-------

Comment 2 Peter Krempa 2012-07-17 15:52:01 UTC
Does this bug reproduce if you leave the machine running for a while (until the guest fully starts up)?

From the output you provided, it looks like the machine was just started (CPU 0 consumed 0.7s cpu time) and the guest OS wasn't able to start the extra processors you assigned to it. This results then in not showing the CPU time: line as the processors didn't consume any time.

Comment 3 Peter Krempa 2012-07-17 15:57:45 UTC
Output from a quick test on my machine that supports the hypothesis:

virsh # start win7
Domain win7 started

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       4.0s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       5.9s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       7.5s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU time:       0.2s
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       8.0s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU time:       0.7s
CPU Affinity:   y---

Comment 4 lei wang 2012-07-18 02:15:39 UTC
(In reply to comment #2)
> Does this bug reproduce if you leave the machine running for a while (until
> the guest fully starts up)?
> 
> From the output you provided, it looks like the machine was just started
> (CPU 0 consumed 0.7s cpu time) and the guest OS wasn't able to start the
> extra processors you assigned to it. This results then in not showing the
> CPU time: line as the processors didn't consume any time.

Hi Peter, you are right, I check this issue again in my test environment, the other cpu is not running before service starting, the cpu will be running once service starting.

[root@localhost ~]# virsh vcpuinfo rhel6q
VCPU:           0
CPU:            0
State:          running
CPU time:       6.0s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y-------

[root@localhost ~]# virsh vcpuinfo rhel6q
VCPU:           0
CPU:            0
State:          running
CPU time:       6.3s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU time:       0.2s
CPU Affinity:   y-------

Comment 5 Peter Krempa 2012-07-19 14:36:14 UTC
Hi Lei,
I'm going to close this as NOTABUG. Please reopen this bug if any of your test machines would show up the same symptoms after the guest OS started all the allocated virtual processors.