Change in vdsm[ovirt-3.5]: virt: Do not count time spent on migrationCreate against tim...

vfeenstr at redhat.com vfeenstr at redhat.com
Thu May 14 12:58:09 UTC 2015


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/40919

to review the following change.

Change subject: virt: Do not count time spent on migrationCreate against timeout
......................................................................

virt: Do not count time spent on migrationCreate against timeout

Currently, the measured time for the source migration timeout includes
the time spent on the destination host. This is bad because the time
spent for some actions during the vm creation can be very expensive and
time consuming.
This patch, excludes the time spent during the destination vm creation
from the measured time.

The change is not expected to introduce regressions on the source, since
even now we would hang on the migrationCreate call.

Change-Id: Iafdaa13136757d455e405328173aa3243bea3995
Bug-Url: https://bugzilla.redhat.com/1221597
Signed-off-by: Vinzenz Feenstra <vfeenstr at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/38397
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-by: Yeela Kaplan <ykaplan at redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/40919/1

diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 1af5748..76c3f7c 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -278,7 +278,17 @@
                     dev._deviceXML, self._vm.conf, dev.custom)
             hooks.before_vm_migrate_source(self._vm._dom.XMLDesc(0),
                                            self._vm.conf)
+
+            # Do not measure the time spent for creating the VM on the
+            # destination. In some cases some expensive operations can cause
+            # the migration to get cancelled right after the transfer started.
+            destCreateStartTime = time.time()
             response = self.destServer.migrationCreate(self._machineParams)
+            destCreationTime = time.time() - destCreateStartTime
+            startTime += destCreationTime
+            self.log.info('Creation of destination VM took: %d seconds',
+                          destCreationTime)
+
             if response['status']['code']:
                 self.status = response
                 raise RuntimeError('migration destination error: ' +


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafdaa13136757d455e405328173aa3243bea3995
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list