Commit 9c9c7d30 authored by Guido Trotter's avatar Guido Trotter
Browse files

Verify: Add and populate node_info dict

During information gathering we collect information from call_node_info, and
then when we cycle trough the nodes add it into a node_info dict containing a
node's free memory and disk. This will be useful later to verify that the
cluster is N+1 redundant. The disk space is saved as well because it can be
useful for checks about disk space redundancy.

Reviewed-by: iustinp
parent 1f9430d6
...@@ -767,6 +767,7 @@ class LUVerifyCluster(NoHooksLU): ...@@ -767,6 +767,7 @@ class LUVerifyCluster(NoHooksLU):
instancelist = utils.NiceSort(self.cfg.GetInstanceList()) instancelist = utils.NiceSort(self.cfg.GetInstanceList())
node_volume = {} node_volume = {}
node_instance = {} node_instance = {}
node_info = {}
# FIXME: verify OS list # FIXME: verify OS list
# do local checksums # do local checksums
...@@ -786,6 +787,7 @@ class LUVerifyCluster(NoHooksLU): ...@@ -786,6 +787,7 @@ class LUVerifyCluster(NoHooksLU):
} }
all_nvinfo = rpc.call_node_verify(nodelist, node_verify_param) all_nvinfo = rpc.call_node_verify(nodelist, node_verify_param)
all_rversion = rpc.call_version(nodelist) all_rversion = rpc.call_version(nodelist)
all_ninfo = rpc.call_node_info(nodelist, self.cfg.GetVGName())
for node in nodelist: for node in nodelist:
feedback_fn("* Verifying node %s" % node) feedback_fn("* Verifying node %s" % node)
...@@ -818,6 +820,23 @@ class LUVerifyCluster(NoHooksLU): ...@@ -818,6 +820,23 @@ class LUVerifyCluster(NoHooksLU):
node_instance[node] = nodeinstance node_instance[node] = nodeinstance
# node_info
nodeinfo = all_ninfo[node]
if not isinstance(nodeinfo, dict):
feedback_fn(" - ERROR: connection to %s failed" % (node,))
bad = True
continue
try:
node_info[node] = {
"mfree": int(nodeinfo['memory_free']),
"dfree": int(nodeinfo['vg_free']),
}
except ValueError:
feedback_fn(" - ERROR: invalid value returned from node %s" % (node,))
bad = True
continue
node_vol_should = {} node_vol_should = {}
for instance in instancelist: for instance in instancelist:
......
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