Commit 7c0aa8e9 authored by Iustin Pop's avatar Iustin Pop
Browse files

Introduce checks for /sys and /proc



This patch adds checks for /proc and /sys in cluster verify, since
Ganeti relies on these special filesystems to be mounted.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent d357f531
......@@ -522,6 +522,17 @@ def VerifyNode(what, cluster_name):
used_minors = str(err)
result[constants.NV_DRBDLIST] = used_minors
if constants.NV_NODESETUP in what:
result[constants.NV_NODESETUP] = tmpr = []
if not os.path.isdir("/sys/block") or not os.path.isdir("/sys/class/net"):
tmpr.append("The sysfs filesytem doesn't seem to be mounted"
" under /sys, missing required directories /sys/block"
" and /sys/class/net")
if (not os.path.isdir("/proc/sys") or
not os.path.isfile("/proc/sysrq-trigger")):
tmpr.append("The procfs filesystem doesn't seem to be mounted"
" under /proc, missing required directory /proc/sys and"
" the file /proc/sysrq-trigger")
return result
......
......@@ -915,6 +915,7 @@ class LUVerifyCluster(LogicalUnit):
ENODERPC = (TNODE, "ENODERPC")
ENODESSH = (TNODE, "ENODESSH")
ENODEVERSION = (TNODE, "ENODEVERSION")
ENODESETUP = (TNODE, "ENODESETUP")
ETYPE_FIELD = "code"
ETYPE_ERROR = "ERROR"
......@@ -1108,6 +1109,10 @@ class LUVerifyCluster(LogicalUnit):
test = minor not in drbd_map
_ErrorIf(test, self.ENODEDRBD, node,
"unallocated drbd minor %d is in use", minor)
test = node_result.get(constants.NV_NODESETUP,
["Missing NODESETUP results"])
_ErrorIf(test, self.ENODESETUP, node, "node setup error: %s",
"; ".join(test))
def _VerifyInstance(self, instance, instanceconfig, node_vol_is,
node_instance, n_offline):
......@@ -1277,6 +1282,7 @@ class LUVerifyCluster(LogicalUnit):
constants.NV_INSTANCELIST: hypervisors,
constants.NV_VERSION: None,
constants.NV_HVINFO: self.cfg.GetHypervisorType(),
constants.NV_NODESETUP: None,
}
if vg_name is not None:
node_verify_param[constants.NV_VGLIST] = None
......
......@@ -518,6 +518,7 @@ NV_NODENETTEST = "node-net-test"
NV_VERSION = "version"
NV_VGLIST = "vglist"
NV_DRBDLIST = "drbd-list"
NV_NODESETUP = "nodesetup"
# Allocator framework constants
IALLOCATOR_VERSION = 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment