Revision 469f88e1
b/lib/cmdlib.py | ||
---|---|---|
1865 | 1865 |
"""Return cluster config. |
1866 | 1866 |
|
1867 | 1867 |
""" |
1868 |
cluster = self.cfg.GetClusterInfo() |
|
1868 | 1869 |
result = { |
1869 |
"name": self.cfg.GetClusterName(), |
|
1870 | 1870 |
"software_version": constants.RELEASE_VERSION, |
1871 | 1871 |
"protocol_version": constants.PROTOCOL_VERSION, |
1872 | 1872 |
"config_version": constants.CONFIG_VERSION, |
1873 | 1873 |
"os_api_version": constants.OS_API_VERSION, |
1874 | 1874 |
"export_version": constants.EXPORT_VERSION, |
1875 |
"master": self.cfg.GetMasterNode(), |
|
1876 | 1875 |
"architecture": (platform.architecture()[0], platform.machine()), |
1877 |
"hypervisor_type": self.cfg.GetHypervisorType(), |
|
1878 |
"enabled_hypervisors": self.cfg.GetClusterInfo().enabled_hypervisors, |
|
1876 |
"name": cluster.cluster_name, |
|
1877 |
"master": cluster.master_node, |
|
1878 |
"hypervisor_type": cluster.hypervisor, |
|
1879 |
"enabled_hypervisors": cluster.enabled_hypervisors, |
|
1880 |
"hvparams": cluster.hvparams, |
|
1881 |
"beparams": cluster.beparams, |
|
1879 | 1882 |
} |
1880 | 1883 |
|
1881 | 1884 |
return result |
b/scripts/gnt-cluster | ||
---|---|---|
145 | 145 |
print ("Architecture (this node): %s (%s)" % |
146 | 146 |
(result["architecture"][0], result["architecture"][1])) |
147 | 147 |
|
148 |
print ("Cluster hypervisor: %s" % result["hypervisor_type"]) |
|
148 |
print ("Default hypervisor: %s" % result["hypervisor_type"]) |
|
149 |
print ("Enabled hypervisors: %s" % ", ".join(result["enabled_hypervisors"])) |
|
150 |
|
|
151 |
print "Hypervisor parameters:" |
|
152 |
for hv_name, hv_dict in result["hvparams"].items(): |
|
153 |
print " - %s:" % hv_name |
|
154 |
for item, val in hv_dict.iteritems(): |
|
155 |
print " %s: %s" % (item, val) |
|
156 |
|
|
157 |
print "Cluster parameters:" |
|
158 |
for gr_name, gr_dict in result["beparams"].items(): |
|
159 |
print " - %s:" % gr_name |
|
160 |
for item, val in gr_dict.iteritems(): |
|
161 |
print " %s: %s" % (item, val) |
|
149 | 162 |
|
150 | 163 |
return 0 |
151 | 164 |
|
Also available in: Unified diff