Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 673814

Summary: [RFE] Add external API to change migration speed
Product: Red Hat Enterprise Linux 6 Reporter: Andrew Cathrow <acathrow>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: ajia, dyuan, eblake, jdenemar, liko, mzhan, rbalakri, weizhan, xen-maint, yoyzhang
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.1-1.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 10:53:47 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:

Description Andrew Cathrow 2011-01-30 17:37:13 UTC
We currently only allow migration speed to be set when the migration is started.
QEMU supports changing this migration speed dynamically. We should expose some form of migration_set_speed externally to allow a management system to adjust the migration speed - this would allow an external management system to increase the bandwidth if it detects the migration is not going to complete in time.

Comment 1 Jiri Denemark 2011-05-13 12:15:35 UTC
This functionality went upstream in a series ending with v0.8.8-235-g83cc3d1:

commit 83cc3d1d55f8a7ea042ecd6dea07347159215f16
Author: Daniel P. Berrange <berrange>
Date:   Thu Feb 17 14:33:00 2011 +0000

    Wire up virDomainMigrateSetSpeed into QEMU driver
    
    Enhance the QEMU migration monitoring loop, so that it can get
    a signal to change migration speed on the fly
    
    * src/qemu/qemu_domain.h: Add signal for changing speed on the fly
    * src/qemu/qemu_driver.c: Wire up virDomainMigrateSetSpeed driver
    * src/qemu/qemu_migration.c: Support signal for changing speed

Comment 2 zhanghaiyan 2011-05-30 04:49:05 UTC
Verified this bug pass with libvirt-0.9.1-1.el6.x86_64
1. Could find the API in libvirt-python
# cat /usr/lib64/python2.6/site-packages/libvirt.py
...
    def migrateSetMaxSpeed(self, bandwidth, flags):
        """The maximum bandwidth (in Mbps) that will be used to do migration
        can be specified with the bandwidth parameter. Not all hypervisors
        will support a bandwidth cap """
        ret = libvirtmod.virDomainMigrateSetMaxSpeed(self._o, bandwidth, flags)
        if ret == -1: raise libvirtError ('virDomainMigrateSetMaxSpeed() failed', dom=self)
        return ret
...
2. Configue migrate env on 2 hosts
3. On source host, # virsh list --all
 Id Name                 State
----------------------------------
 8 rhel61_1             running
# virsh migrate rhel61_1 qemu+ssh://10.66.5.5/system
4. During migration, execute the following commands
 # python
Python 2.6.6 (r266:84292, Apr 11 2011, 15:50:32) 
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open ("qemu:///system")
>>> dom = con.lookupByID (8)
>>> dom.migrateSetMaxSpeed(2,0)
0

Comment 4 Min Zhan 2011-07-18 07:20:40 UTC
Move to Verified according to Comment #2

Comment 5 errata-xmlrpc 2011-12-06 10:53:47 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-2011-1513.html