Commit e9ce0a64 authored by Iustin Pop's avatar Iustin Pop
Browse files

Implement software release version checks too

Currently the LUVerifyCluster only reports the protocol version changes,
not software ones. This is useful to know/monitor, so we add this too as
a warning.

Reviewed-by: ultrotter
parent 5ffaa51d
......@@ -426,7 +426,8 @@ def VerifyNode(what, cluster_name):
result[constants.NV_VGLIST] = ListVolumeGroups()
if constants.NV_VERSION in what:
result[constants.NV_VERSION] = constants.PROTOCOL_VERSION
result[constants.NV_VERSION] = (constants.PROTOCOL_VERSION,
constants.RELEASE_VERSION)
if constants.NV_HVINFO in what:
hyper = hypervisor.GetHypervisor(what[constants.NV_HVINFO])
......
......@@ -650,18 +650,28 @@ class LUVerifyCluster(LogicalUnit):
# compares ganeti version
local_version = constants.PROTOCOL_VERSION
remote_version = node_result.get('version', None)
if not remote_version:
if not (remote_version and isinstance(remote_version, (list, tuple)) and
len(remote_version) == 2):
feedback_fn(" - ERROR: connection to %s failed" % (node))
return True
if local_version != remote_version:
feedback_fn(" - ERROR: sw version mismatch: master %s, node(%s) %s" %
(local_version, node, remote_version))
if local_version != remote_version[0]:
feedback_fn(" - ERROR: incompatible protocol versions: master %s,"
" node %s %s" % (local_version, node, remote_version[0]))
return True
# checks vg existance and size > 20G
# node seems compatible, we can actually try to look into its results
bad = False
# full package version
if constants.RELEASE_VERSION != remote_version[1]:
feedback_fn(" - WARNING: software version mismatch: master %s,"
" node %s %s" %
(constants.RELEASE_VERSION, node, remote_version[1]))
# checks vg existence and size > 20G
vglist = node_result.get(constants.NV_VGLIST, None)
if not vglist:
feedback_fn(" - ERROR: unable to check volume groups on node %s." %
......
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