Tomas Jelinek has uploaded a new change for review.

Change subject: migration: Add support for max migration bandwidth setting
......................................................................

migration: Add support for max migration bandwidth setting

Enriched the migrate verb by maxBandwidth.

It is an optional argument and the fallback is to migration_max_bandwidth from
config.

Feature-Page: http://www.ovirt.org/Features/Migration_Enhancements
Change-Id: I9d99e488a9e8bb80b0c3c069628171c666f3bf4b
Signed-off-by: Tomas Jelinek <[email protected]>
---
M client/vdsClient.py
M vdsm/API.py
M vdsm/virt/migration.py
3 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/46846/1

diff --git a/client/vdsClient.py b/client/vdsClient.py
index 71b559a..29f6ba4 100755
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -2221,13 +2221,14 @@
         'migrate': (serv.do_migrate,
                     ('vmId=<id> method=<offline|online> src=<host[:port]> '
                      'dst=<host[:port]>  dstqemu=<host> [consoleAddress:str] '
-                     '[autoConverge:bool] [compressed:bool]',
+                     '[autoConverge:bool] [compressed:bool] 
[maxBandwidth:int]',
                      'Migrate a desktop from src machine to dst host using '
                      'the specified ports and an optional address for '
                      'migration data traffic.',
                      'o consoleAddress: destination host grapics address',
                      'o autoConverge: force convergence during migration',
                      'o compressed: compress repeated pages during migration'
+                     'o maxBandwidth: max bandwidth used by this migration'
                      )),
         'migrateStatus': (serv.do_mStat,
                           ('<vmId>',
diff --git a/vdsm/API.py b/vdsm/API.py
index e3b9241..8b5eb1b 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -532,6 +532,7 @@
             *dstqemu* - remote host address dedicated for migration
             *compressed* - compress repeated pages during live migration
             *autoConverge* - force convergence during live migration
+            *maxBandwidth* - max bandwidth used by this specific migration
         """
         params['vmId'] = self._UUID
         self.log.debug(params)
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 32caccb..46bbfee 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -93,6 +93,8 @@
         self._dstqemu = dstqemu
         self._downtime = kwargs.get('downtime') or \
             config.get('vars', 'migration_downtime')
+        self._maxBandwidth = kwargs.get('maxBandwidth') or \
+            config.getint('vars', 'migration_max_bandwidth')
         self._autoConverge = autoConverge
         self._compressed = compressed
         self.status = {
@@ -371,7 +373,6 @@
             SPICE_MIGRATION_HANDOVER_TIME = 120
             self._vm._reviveTicket(SPICE_MIGRATION_HANDOVER_TIME)
 
-        maxBandwidth = config.getint('vars', 'migration_max_bandwidth')
         # FIXME: there still a race here with libvirt,
         # if we call stop() and libvirt migrateToURI3 didn't start
         # we may return migration stop but it will start at libvirt
@@ -380,7 +381,7 @@
         if not self._migrationCanceledEvt:
             # TODO: use libvirt constants when bz#1222795 is fixed
             params = {VIR_MIGRATE_PARAM_URI: str(muri),
-                      VIR_MIGRATE_PARAM_BANDWIDTH: maxBandwidth}
+                      VIR_MIGRATE_PARAM_BANDWIDTH: int(self._maxBandwidth)}
             if self._consoleAddress:
                 if self._vm.hasSpice:
                     graphics = 'spice'


-- 
To view, visit https://gerrit.ovirt.org/46846
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d99e488a9e8bb80b0c3c069628171c666f3bf4b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to