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

shavivi at redhat.com shavivi at redhat.com
Mon Mar 23 12:54:31 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

Added new value to migrateStatus verb: downtime.
downtime reports the actual time that the VM was offline (ie not
available for the user).

Change-Id: I4d213ed2acb9a9556fa6e9197f686133a69b0646
Signed-off-by: Shahar Havivi <shaharh at redhat.com>
---
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/migration.py
2 files changed, 19 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/39039/1

diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 52dea77..f0f978a 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -6433,6 +6433,18 @@
  'data': {'vmID': 'UUID'},
  'returns': 'VmDefinition'}
 
+##
+# @MigrationStatusInfo:
+#
+# Information regarding migration
+# on error return what cause the error
+# on success added actulal downtime of the VM
+#
+# @downtime:  total time the the VM was offline
+#
+# Since: 4.17.0
+##
+{'type', 'MigrationStatusInfo', 'data': {'downtime': 'str'}}
 
 ##
 # @VM.getMigrationStatus:
@@ -6447,7 +6459,8 @@
 #        'message')
 ##
 {'command': {'class': 'VM', 'name': 'getMigrationStatus'},
- 'data': {'vmID': 'UUID'}}
+ 'data': {'vmID': 'UUID'},
+ 'returns': 'MigrationStatusInfo'}
 
 ##
 # @VmExitCode:
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index c2a112e..6ad02d6 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -97,6 +97,11 @@
         if self._monitorThread is not None:
             # fetch migration status from the monitor thread
             self.status['progress'] = self._monitorThread.progress
+
+        stat = self._vm._dom.jobStats(libvirt.VIR_DOMAIN_JOB_STATS_COMPLETED)
+        if 'downtime' in stat:
+            self.status['downtime'] = stat['downtime']
+
         return self.status
 
     def _setupVdsConnection(self):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d213ed2acb9a9556fa6e9197f686133a69b0646
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