Change in vdsm[master]: RFE: Report downtime for each live migration

shavivi at redhat.com shavivi at redhat.com
Mon Jan 19 15:25:17 UTC 2015


Shahar Havivi has uploaded a new change for review.

Change subject: RFE: Report downtime for each live migration
......................................................................

RFE: Report downtime for each live migration

Change-Id: I34260160404a2b3cc7d26f76a16cfa2385fa9017
Bug-Url: https://bugzilla.redhat.com/970711
Signed-off-by: Shahar Havivi <shaharh at redhat.com>
---
M vdsm/virt/migration.py
M vdsm/virt/vm.py
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/37075/1

diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 6afa9d4..db55bc9 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -80,7 +80,8 @@
             'status': {
                 'code': 0,
                 'message': 'Migration in progress'},
-            'progress': 0}
+            'progress': 0,
+            'downtime': 0}
         threading.Thread.__init__(self)
         self._preparingMigrationEvt = True
         self._migrationCanceledEvt = False
@@ -97,6 +98,7 @@
         if self._monitorThread is not None:
             # fetch migration status from the monitor thread
             self.status['progress'] = self._monitorThread.progress
+            self.status['downtime'] = self._monitorThread.downtime
         return self.status
 
     def _setupVdsConnection(self):
@@ -415,6 +417,7 @@
         self._startTime = startTime
         self.daemon = True
         self.progress = 0
+        self.downtime = 0
 
     @property
     def enabled(self):
@@ -490,6 +493,9 @@
                 self._vm.log.info('Migration Progress: %s seconds elapsed,'
                                   ' %s%% of data processed' %
                                   (timeElapsed / 1000, self.progress))
+            jobStats = self._vm._dom.jobStats()
+            if 'downtime' in jobStats:
+                self.downtime = jobStats['downtime']
 
     def stop(self):
         self._vm.log.debug('stopping migration monitor thread')
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index bee1098..a740c9f 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1797,6 +1797,7 @@
             stats['pauseCode'] = self.conf['pauseCode']
         if self.isMigrating():
             stats['migrationProgress'] = self.migrateStatus()['progress']
+            stats['migrationDowntime'] = self.migrateStatus()['downtime']
 
         decStats = {}
         try:


-- 
To view, visit http://gerrit.ovirt.org/37075
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34260160404a2b3cc7d26f76a16cfa2385fa9017
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>


More information about the vdsm-patches mailing list