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 1083483 - The guest migrate very slow while set the migrate-speed to -1
Summary: The guest migrate very slow while set the migrate-speed to -1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-02 10:34 UTC by zhenfeng wang
Modified: 2014-10-14 04:21 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.10.2-34.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 04:21:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Description zhenfeng wang 2014-04-02 10:34:26 UTC
Description of problem:
The guest migrate very slow while set the migrate-speed to -1, this issue happens while migrate from rhel6 host to rhel6 host and from rhel6 host to rhel7 host

Version-Release number of selected component (if applicable):
6.5 host(source)
kernel-2.6.32-431.11.1.el6.x86_64
libvirt-0.10.2-29.el6_5.7.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.5.x86_64

7.0 host (target)
libvirt-1.1.1-29.el7.x86_64
qemu-kvm-rhev-1.5.3-59.el7ev.x86_64
kernel-3.10.0-115.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare two hosts, Ensure the source host is rhel6, target host can be rhel6 or rhel7

2.Set setenforce 1 && virt_use_nfs 1 (on both source and target)

3.Prepare a guest which the image file is on the NFS server,and mount
the nfs server on both source and target, then start a guest on the source

4.migrate the guest to the target with the default migrate-speed
# virsh migrate-getspeed rhel75
8796093022207

# time virsh migrate --live rhel6m qemu+ssh://$target_ip/system --verbose
root.106.35's password:
Migration: [100 %]

real        0m11.203s
user        0m0.026s
sys        0m0.017s

5.Destroy the guest on the target , re-boot the guest from source, set the migrate-speed to -1 then, re-migrate the guest to the target and check the migration time, find the migration time will be longer than the default migrate-speed spent.

# virsh migrate-setspeed rhel75 -1

# virsh migrate-getspeed rhel75
18446744073709551615

# time virsh migrate --live rhel75 qemu+ssh://$target_ip/system --verbose
root.106.35's password:
Migration: [100 %]


real        30m41.472s
user        0m1.094s
sys        0m0.594s


6.The guest will migrate very fast from rhel7 host to rhel7 host while set the migrate-speed to -1
 
Actual results:
The guest migrate very slow while set the migrate-speed to -1 when migrate the guest from rhel6 to rhel6 or from rhel6 to rhel7

Expected results:
while set the migrate-speed to -1,  it should spend shorter migration time than the default migrate-speed
 
Additional info:

Comment 2 Jiri Denemark 2014-04-07 14:03:10 UTC
I suspect this is something deep in qemu. But I don't see any reason for trying to increase the bandwidth from something that is already more than one can currently achieve (8796093022207 MiB/s is 8EiB/s). Thus I think this is not worth fixing given that it has already been fixed upstream/RHEL-7.

Comment 3 RHEL Program Management 2014-04-07 14:17:03 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 4 Jiri Denemark 2014-04-08 11:56:00 UTC
Oh, I was judging just by the fact it works in RHEL-7 and since libvirt did not change in this part, I though our code was correct. I should have double checked :-) QEMU likely changed something so that it started working but libvirt code is what needs to be fixed. The default maximum migration speed of 8796093022207 MiB/s is INT64_MAX / (1024 * 1024), where INT64_MAX is the maximum value QEMU supports and we need to divide it by 1024 * 1024 because QEMU takes B/s while we use MiB/s.

When virsh migrate-setspeed gets -1, it calls virDomainMigrateSetMaxSpeed API with bandwidth = 18446744073709551615 (which is (uint64_t) -1), libvirt then happily takes that, multiplies it by 1024 * 1024 and sends {"execute":"migrate_set_speed","arguments":{"value":-1048576},"id":"libvirt-8"} QMP command to QEMU. The magic -1048576 (-1 * 1024 * 1024) value is a result of taking 18446744073709551615, multiplying it by 1024 * 1024, which overflows to 18446744073708503040, and casting it to long long when creating JSON objects.

All that said, libvirt should either forbid or silently crop migration speed to QEMU_DOMAIN_MIG_BANDWIDTH_MAX.

Comment 5 Jiri Denemark 2014-04-14 12:39:01 UTC
Now fixed upstream by v1.2.3-125-gc4206d7:

commit c4206d7c7e2c82bcdabd8a7548e14c48cdab4e14
Author: Jiri Denemark <jdenemar>
Date:   Fri Apr 11 11:24:51 2014 +0200

    qemu: Avoid overflow when setting migration speed
    
    When passing migration bandwidth to QEMU, we multiply it by 1024 * 1024
    to convert the speed to B/s and the result still needs to fit in
    int64_t.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1083483
    
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 6 Jiri Denemark 2014-04-25 14:07:56 UTC
https://www.redhat.com/archives/libvir-list/2014-April/msg00992.html is needed to fix similar bug in case the domain is not running.

Comment 7 Jiri Denemark 2014-04-25 14:34:42 UTC
The additional patch is now upstream as v1.2.3-190-gdff3ad0:

commit dff3ad004acd2c8754a76553742cc5c18c77766c
Author: Jiri Denemark <jdenemar>
Date:   Fri Apr 11 11:24:51 2014 +0200

    qemu: Avoid overflow when setting migration speed on inactive domains
    
    Commit c4206d7 fixed the overflow for running domains. However, we need
    a similar check when setting migration speed on inactive domains.
    
    At first look, it may seem the check in c4206d7 is now redundant but
    qemuDomainMigrateSetMaxSpeed is not the only caller of
    qemuMonitorSetMigrationSpeed so we need to check the bandwidth in both
    places.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1083483
    
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 10 zhe peng 2014-07-08 08:27:29 UTC
I can reproduce this.
Verify with build: 
libvirt-0.10.2-40.el6.x86_64

step:
for active guest:
#virsh domstate rhel6
running
#virsh migrate-setspeed rhel6 -1
error: numerical overflow: bandwidth must be less than 8796093022208

for inactive guest:
# virsh domstate rhel6
shut off
#virsh migrate-setspeed rhel6 -1
error: numerical overflow: bandwidth must be less than 8796093022208

try others value of speed
18446744073709551615
0
8796093022208
all can get the error, move to verified.

Comment 12 errata-xmlrpc 2014-10-14 04:21:03 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.

http://rhn.redhat.com/errata/RHBA-2014-1374.html


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