Bug 673814 - [RFE] Add external API to change migration speed
Summary: [RFE] Add external API to change migration speed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-30 17:37 UTC by Andrew Cathrow
Modified: 2014-09-07 22:53 UTC (History)
10 users (show)

Fixed In Version: libvirt-0.9.1-1.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:53:47 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

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


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