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 1282744 - Actual downtime - Sometimes libvirt doesn't report 'downtime_net' in jobStats while migrating VM/s
Summary: Actual downtime - Sometimes libvirt doesn't report 'downtime_net' in jobStats...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard: virt
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-17 10:11 UTC by Michael Burman
Modified: 2016-11-03 18:30 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.3.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:30:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
source log (312.26 KB, application/x-gzip)
2015-11-18 12:46 UTC, Michael Burman
no flags Details
destination log (173.51 KB, application/x-gzip)
2015-11-18 13:08 UTC, Michael Burman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Michael Burman 2015-11-17 10:11:33 UTC
Description of problem:
Actual downtime - Sometimes libvirt doesn't report 'downtime_net' in jobStats while migrating VM/s.

- We are running this code on the destination host:

stat = self._vm._dom.jobStats(libvirt.VIR_DOMAIN_JOB_STATS_COMPLETED)
        if 'downtime_net' in stat:
            ...

and in some cases 'downtime_net' key is not exists in stat.

As a result, Actual downtime reported as :(N/A) in the events log in UI.
And sometimes reports 37ms, 47ms.. 

- Note that migration is fast - 16, 18, 29, 30, 33 seconds..


Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7.x86_64
vdsm-4.17.10.1-0.el7ev.noarch
RHEL - 7.2 - 9.el7
3.10.0 - 327.el7.x86_64

How reproducible:
50-70%

Steps to Reproduce:
1. Run live migration between 2 rhel 7.2 servers in latest 3.6 RHEV-M UI

Actual results:
Sometimes the Event log in the UI reports:
Migration completed (VM: v3, Source: silver-vdsa.qa.lab.tlv.redhat.com, Destination: orchid-vds2.qa.lab.tlv.redhat.com, Duration: 18 seconds, Total: 18 seconds, Actual downtime: (N/A))

Expected results:
Always report Actual downtime.

Comment 2 Jiri Denemark 2015-11-18 08:44:54 UTC
Could you attach libvirtd debug logs from both source and destination hosts?

Comment 3 Michael Burman 2015-11-18 12:46:42 UTC
Created attachment 1096025 [details]
source log

Comment 4 Michael Burman 2015-11-18 13:08:42 UTC
Created attachment 1096052 [details]
destination log

Comment 5 Jiri Denemark 2016-03-08 15:50:46 UTC
Fixed upstream by v1.3.2-86-gcb483a6:

commit cb483a68fdc3503efc9b0996570e58aaf0c11c17
Author:     Jiri Denemark <jdenemar>
AuthorDate: Tue Feb 23 10:47:01 2016 +0100
Commit:     Jiri Denemark <jdenemar>
CommitDate: Tue Mar 8 16:26:00 2016 +0100

    qemu: Fix a race when computing migration downtime
    
    Computing a total downtime during a migration requires us to store a
    time stamp when guest CPUs get stopped. The value (and all other
    statistics) is then transferred to the destination to compute the
    downtime. Because the stopped time stamp is stored by a STOP event
    handler while the statistics which will be sent over to the destination
    are copied synchronously within qemuMigrationWaitForCompletion.
    
    Depending on the timing of STOP and MIGRATION events, we may end up
    copying (and transferring) statistics without the stopped time stamp
    set. Let's make sure we always use the correct time stamp.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1282744
    
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 6 Mike McCune 2016-03-28 22:45:31 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 8 zhe peng 2016-09-13 02:26:30 UTC
test with pure libvirt:
libvirt-2.0.0-8.el7.x86_64
qemu-kvm-rhev-2.6.0-24.el7.x86_64

step:
1: prepare two machine
2: loop live migration 60 times
3: check downtime every time both on source and target

statistics always get actual downtime.

Comment 9 zhe peng 2016-09-14 07:26:23 UTC
test with RHV
both source and target build:
libvirt-2.0.0-8.el7.x86_64
vdsm-4.18.13-1.el7ev.x86_64
3.10.0-505.el7.x86_64

test ping-pong migration from 2 rhel 7.3 servers
check event log in the UI reports:
Migration completed (VM: n2, Source: A, Destination: B, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 368ms)
Migration completed (VM: n2, Source: B, Destination: A, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 310ms)
Migration completed (VM: n2, Source: A, Destination: B, Duration: 54 seconds, Total: 54 seconds, Actual downtime: 365ms)
Migration completed (VM: n2, Source: B, Destination: A, Duration: 55 seconds, Total: 55 seconds, Actual downtime: 302ms)
Migration completed (VM: n2, Source: A, Destination: B, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 373ms)
Migration completed (VM: n2, Source: B, Destination: A, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 303ms)
Migration completed (VM: n2, Source: A, Destination: B, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 387ms)
Migration completed (VM: n2, Source: B, Destination: A, Duration: 53 seconds, Total: 53 seconds, Actual downtime: 299ms)
Migration completed (VM: n2, Source: A, Destination: B, Duration: 54 seconds, Total: 54 seconds, Actual downtime: 389ms)
Migration completed (VM: n2, Source: B, Destination: A, Duration: 54 seconds, Total: 54 seconds, Actual downtime: 266ms)

all get actual downtime. 
worked as expect, move to verified.

Comment 11 errata-xmlrpc 2016-11-03 18:30:54 UTC
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.

https://rhn.redhat.com/errata/RHSA-2016-2577.html


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