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

Show OS parameters in cluster/instance info

Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 1bdcbbab
......@@ -3778,6 +3778,7 @@ class LUQueryClusterInfo(NoHooksLU):
for hypervisor_name in cluster.enabled_hypervisors]),
"os_hvp": os_hvp,
"beparams": cluster.beparams,
"osparams": cluster.osparams,
"nicparams": cluster.nicparams,
"candidate_pool_size": cluster.candidate_pool_size,
"master_netdev": cluster.master_netdev,
......@@ -8250,6 +8251,8 @@ class LUQueryInstanceData(NoHooksLU):
"hv_actual": cluster.FillHV(instance, skip_globals=True),
"be_instance": instance.beparams,
"be_actual": cluster.FillBE(instance),
"os_instance": instance.osparams,
"os_actual": cluster.SimpleFillOS(instance.os, instance.osparams),
"serial_no": instance.serial_no,
"mtime": instance.mtime,
"ctime": instance.ctime,
......@@ -274,9 +274,12 @@ def ShowClusterConfig(opts, args):
ToStdout("Hypervisor parameters:")
ToStdout("OS specific hypervisor parameters:")
ToStdout("OS-specific hypervisor parameters:")
ToStdout("OS parameters:")
ToStdout("Cluster parameters:")
ToStdout(" - candidate pool size: %s",
......@@ -1111,6 +1111,21 @@ def _FormatList(buf, data, indent_level):
_FormatList(buf, elem, indent_level+1)
def _FormatParameterDict(buf, per_inst, actual):
"""Formats a parameter dictionary.
@type buf: L{StringIO}
@param buf: the buffer into which to write
@type per_inst: dict
@param per_inst: the instance's own parameters
@type actual: dict
@param actual: the current parameter set (including defaults)
for key in sorted(actual):
val = per_inst.get(key, "default (%s)" % actual[key])
buf.write(" - %s: %s\n" % (key, val))
def ShowInstanceConfig(opts, args):
"""Compute instance run-time status.
......@@ -1159,6 +1174,7 @@ def ShowInstanceConfig(opts, args):
buf.write(" - primary: %s\n" % instance["pnode"])
buf.write(" - secondaries: %s\n" % utils.CommaJoin(instance["snodes"]))
buf.write(" Operating system: %s\n" % instance["os"])
_FormatParameterDict(buf, instance["os_instance"], instance["os_actual"])
if instance.has_key("network_port"):
buf.write(" Allocated network port: %s\n" %
......@@ -1185,12 +1201,7 @@ def ShowInstanceConfig(opts, args):
buf.write(" - console connection: vnc to %s\n" % vnc_console_port)
for key in sorted(instance["hv_actual"]):
if key in instance["hv_instance"]:
val = instance["hv_instance"][key]
val = "default (%s)" % instance["hv_actual"][key]
buf.write(" - %s: %s\n" % (key, val))
_FormatParameterDict(buf, instance["hv_instance"], instance["hv_actual"])
buf.write(" Hardware:\n")
buf.write(" - VCPUs: %s\n" %
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