Change in vdsm[master]: WIP: virt: avoid periodic operations on DOWN vms

fromani at redhat.com fromani at redhat.com
Mon Mar 30 15:20:31 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: WIP: virt: avoid periodic operations on DOWN vms
......................................................................

WIP: virt: avoid periodic operations on DOWN vms

Avoid scary but harmless stacktraces
when VM is down but not yet collected by Engine
(e.g. after migration)

Change-Id: I63ba190b2f2830292ec282c1ec5c8eb8e42f3530
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/periodic.py
1 file changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/39370/1

diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index 529fd61..92a9f7f 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -33,6 +33,7 @@
 from vdsm.utils import monotonic_time
 
 from . import sampling
+from . import vmstatus
 from .errors import TimeoutError
 
 
@@ -265,7 +266,8 @@
 
     @property
     def runnable(self):
-        return self._vm.isDomainReadyForCommands()
+        return (self._vm.lastStatus != vmstatus.DOWN and
+                self._vm.isDomainReadyForCommands())
 
     def __call__(self):
         for drive in self._vm.getDiskDevices():
@@ -282,7 +284,8 @@
 
     @property
     def required(self):
-        return self._vm.hasGuestNumaNode
+        return (self._vm.lastStatus != vmstatus.DOWN and
+                self._vm.hasGuestNumaNode)
 
     @property
     def runnable(self):
@@ -307,7 +310,8 @@
         # though they will do nothing but a few check and exit
         # early, as they do if a VM doesn't have Block Jobs to
         # monitor (most often true).
-        return self._vm.hasVmJobs
+        return (self._vm.lastStatus != vmstatus.DOWN and
+                self._vm.hasVmJobs)
 
     @property
     def runnable(self):
@@ -328,7 +332,8 @@
     @property
     def required(self):
         # Avoid queries from storage during recovery process
-        return self._vm.isDisksStatsCollectionEnabled()
+        return (self._vm.lastStatus != vmstatus.DOWN and
+                self._vm.isDisksStatsCollectionEnabled())
 
     @property
     def runnable(self):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63ba190b2f2830292ec282c1ec5c8eb8e42f3530
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list