Milan Zamazal has uploaded a new change for review.

Change subject: virt: Prevent monitoring of VMs in post-copy
......................................................................

virt: Prevent monitoring of VMs in post-copy

Migrating VMs in post-copy mode on the source end are paused.  It makes
no sense to monitor them and we don't want to get error messages in the
log or experience other problems.  So we skip VMs in that state in
periodic operations.

We also skip the VMs that just successfully initiated switching to
post-copy mode.  Under normal circumstances, they should enter post-copy
mode shortly afterwards, so it's better to skip them immediately.

We still can't guarantee (without excessive locking) that VM doesn't
switch to post-copy (and gets paused), so we handle the corresponding
contingent failure as well.

Note that we still gather stats, since we need to know the migration
progress.

Change-Id: I010d3311ce497081720a871e2a3c715f53dcb299
Signed-off-by: Milan Zamazal <mzama...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/1354343
---
M lib/vdsm/virt/periodic.py
M vdsm/virt/vm.py
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/64146/7

diff --git a/lib/vdsm/virt/periodic.py b/lib/vdsm/virt/periodic.py
index 132fe93..959ff1b 100644
--- a/lib/vdsm/virt/periodic.py
+++ b/lib/vdsm/virt/periodic.py
@@ -290,7 +290,8 @@
     def required(self):
         # Disable everything until the migration destination VM
         # is fully started, to avoid false positives log spam.
-        return not self._vm.incomingMigrationPending()
+        return (not self._vm.incomingMigrationPending() and
+                not self._vm.post_copy_initiated)
 
     @property
     def runnable(self):
@@ -307,6 +308,9 @@
             self._vm.log.warning('could not run on %s: domain not connected',
                                  self._vm.id)
         except libvirt.libvirtError as e:
+            if self._vm.in_post_copy:
+                # race on entering post-copy, VM paused now
+                return
             if e.get_error_code() in (
                 # race on shutdown/migration completion
                 libvirt.VIR_ERR_NO_DOMAIN,
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f806c45..2fb498a 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -323,6 +323,11 @@
     def in_post_copy(self):
         return self._in_post_copy
 
+    @property
+    def post_copy_initiated(self):
+        return (self._in_post_copy or
+                self._migrationSourceThread.post_copy_initiated)
+
     def _get_lastStatus(self):
         # note that we don't use _statusLock here. One of the reasons is the
         # non-obvious recursive locking in the following flow:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I010d3311ce497081720a871e2a3c715f53dcb299
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to