Bug 1325800

Summary: "domjobinfo --complete" displays different time elapsed and time elapsed w/o on both hosts after migration.
Product: Red Hat Enterprise Linux 7 Reporter: Dan Zheng <dzheng>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: dyuan, fjin, gsun, mzhan, rbalakri, yafu, zpeng
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: 2016-07-18 14:39:54 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:

Description Dan Zheng 2016-04-11 08:49:00 UTC
Description of problem:
"domjobinfo --complete" displays different time elapsed and time elapsed w/o after migration.
This issue should be a regression. It does not exist on libvirt-1.3.2-1.el7.x86_64.

Version-Release number of selected component (if applicable):
libvirt-1.3.3-1.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Setup nfs on both hosts.
On remote host:
# df -k
10.66.5.225:/usr/share/avocado/data/avocado-vt/images  52403200 33089536  19313664  64% /var/lib/libvirt/migrate
Guest XML:
<devices>
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/migrate/jeos-21-64.qcow2'/>
      <target dev='vda' bus='virtio'/>
...
    </disk>

2. Run migration command:
   virsh migrate avocado-vt-vm-ci --live --verbose --unsafe qemu+ssh://10.66.4.167:22/system
Migration: [100 %]
Migration succeeds.

3. On the local host, run domjobinfo:
/bin/virsh domjobinfo avocado-vt-vm-ci --completed
Job type:         Completed  
Time elapsed:     2950         ms
Time elapsed w/o network: 2945         ms
Data processed:   231.416 MiB
Data remaining:   0.000 B
Data total:       1.016 GiB
Memory processed: 231.416 MiB
Memory remaining: 0.000 B
Memory total:     1.016 GiB
Memory bandwidth: 93.107 MiB/s
Dirty rate:       0            pages/s
Iteration:        4          
Constant pages:   209288      
Normal pages:     58668      
Normal data:      229.172 MiB
Total downtime:   118          ms
Downtime w/o network: 113          ms
Setup time:       8            ms

4. On the remote host run domjobinfo:
#  /bin/virsh domjobinfo avocado-vt-vm-ci --completed
Job type:         Completed  
Time elapsed:     2949         ms
Time elapsed w/o network: 2944         ms
Data processed:   231.416 MiB
Data remaining:   0.000 B
Data total:       1.016 GiB
Memory processed: 231.416 MiB
Memory remaining: 0.000 B
Memory total:     1.016 GiB
Memory bandwidth: 93.107 MiB/s
Dirty rate:       0            pages/s
Iteration:        4          
Constant pages:   209288      
Normal pages:     58668      
Normal data:      229.172 MiB
Total downtime:   118          ms
Downtime w/o network: 113          ms
Setup time:       8            ms



Actual results:
"Time elapsed" and "Time elapsed w/o network" are different on both hosts.

Expected results:
They should be equal.

Additional info:

Comment 2 Jiri Denemark 2016-07-18 14:39:54 UTC
This is actually expected because there's no way the source libvirtd could send the statistics to the destination libvirtd once migration is complete. The statistics are sent when the destination libvirtd is asked to start the newly migrated domain, but the source libvirtd keeps measuring the total time until it kills the domain on the source host.