Change in vdsm[master]: vdsm: check libvirt availability at startup

fromani at redhat.com fromani at redhat.com
Wed Nov 26 12:16:19 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: vdsm: check libvirt availability at startup
......................................................................

vdsm: check libvirt availability at startup

When VDSM starts, it checks the availability
of the needed servers, like supervdsm, and panic()s
if it cannot connects to them.

libvirtd is among the critical dependencies of VDSM,
yet its presence is checked lazily.
This may lead to the scenario on which VDSM starts
up without a valid libvirt connection, a situation
that we try hard to avoid otherwise.

This is not a made up scenario. If libvirt crashes,
VDSM detects that and kills itself; it is possible,
although unlikely, that VDSM respawns faster than
libvirt, especially on overloaded systems.

This patch adds an explicit check about libvirt
availability, and makes VDSM panic() if no connection
at all is possible.

As side effect of this approach, the internal
connection pool is populated early, so the builtin
existing protection against libvirt crashes engages
earlier for added safety.

Change-Id: I36137a424427b03a5dd3f24b5a7af1af454d0a23
Related-To: https://bugzilla.redhat.com/1167388
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/vdsm
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/35596/1

diff --git a/vdsm/vdsm b/vdsm/vdsm
index 5c1ab71..e5d69bc 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -79,6 +79,13 @@
 
     libvirtconnection.start_event_loop()
 
+    try:
+        conn = libvirtconnection.get()
+    except Exception:
+        conn = None
+    if not conn:
+        utils.panic("failed to connect to libvirt")
+
     if config.getboolean('irs', 'irs_enable'):
         try:
             irs = Dispatcher(HSM())


-- 
To view, visit http://gerrit.ovirt.org/35596
To unsubscribe, visit http://gerrit.ovirt.org/settings

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