Peter V. Saveliev has uploaded a new change for review.
Change subject: vdsm: catch timeout while starting VM
......................................................................
vdsm: catch timeout while starting VM
If the requested VM does not start within given timeout,
set its status to «down» and throw an exception.
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=755528
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
Change-Id: I233d3c6cf1e62e46d005b8a6d502a02438100daa
---
M vdsm/vm.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/12235/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 8b2bbb6..19e6aa4 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -35,6 +35,7 @@
import libvirt
from vdsm import vdscli
+__timeout__ = 10
DEFAULT_BRIDGE = config.get("vars", "default_bridge")
DISK_DEVICES = 'disk'
@@ -657,6 +658,10 @@
def run(self):
self._creationThread.start()
+ self._creationThread.join(__timeout__)
+ if self._creationThread.is_alive():
+ self.setDownStatus(ERROR, 'timeout while starting vm')
+ raise Exception("timeout exception")
def memCommit(self):
"""
--
To view, visit
http://gerrit.ovirt.org/12235
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I233d3c6cf1e62e46d005b8a6d502a02438100daa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>