diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 62c1c8d0c2ab8999ea839748e1ff2320601834cd..e0cbe8680f3d5b5277d2aad634b568509389c94e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -691,7 +691,7 @@ class LUVerifyCluster(LogicalUnit): needed_mem = 0 for instance in instances: bep = self.cfg.GetClusterInfo().FillBE(instance_cfg[instance]) - if bep[constants.BE_AUTOBALANCE]: + if bep[constants.BE_AUTO_BALANCE]: needed_mem += bep[constants.BE_MEMORY] if nodeinfo['mfree'] < needed_mem: feedback_fn(" - ERROR: not enough memory on node %s to accomodate" @@ -857,7 +857,7 @@ class LUVerifyCluster(LogicalUnit): feedback_fn(" - WARNING: multiple secondaries for instance %s" % instance) - if not cluster.FillBE(inst_config)[constants.BE_AUTOBALANCE]: + if not cluster.FillBE(inst_config)[constants.BE_AUTO_BALANCE]: i_non_a_balanced.append(instance) for snode in inst_config.secondary_nodes: @@ -4625,8 +4625,8 @@ class LUSetInstanceParams(LogicalUnit): if constants.BE_MEMORY in self.op.beparams and not self.force: mem_check_list = [pnode] - if be_new[constants.BE_AUTOBALANCE]: - # either we changed autobalance to yes or it was from before + if be_new[constants.BE_AUTO_BALANCE]: + # either we changed auto_balance to yes or it was from before mem_check_list.extend(instance.secondary_nodes) instance_info = self.rpc.call_instance_info(pnode, instance.name, instance.hypervisor) @@ -4651,7 +4651,7 @@ class LUSetInstanceParams(LogicalUnit): " from starting, due to %d MB of memory" " missing on its primary node" % miss_mem) - if be_new[constants.BE_AUTOBALANCE]: + if be_new[constants.BE_AUTO_BALANCE]: for node in instance.secondary_nodes: if node not in nodeinfo or not isinstance(nodeinfo[node], dict): self.warn.append("Can't get info from secondary node %s" % node) diff --git a/lib/constants.py b/lib/constants.py index 69049ccebfc670201e062e5ff99ed57c82b16eee..6dae294629b2492b4d49021e246068f205118d25 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -278,12 +278,12 @@ HVS_PARAMETERS = frozenset([ # BE parameter names BE_MEMORY = "memory" BE_VCPUS = "vcpus" -BE_AUTOBALANCE = "auto_balance" +BE_AUTO_BALANCE = "auto_balance" BES_PARAMETERS = frozenset([ BE_MEMORY, BE_VCPUS, - BE_AUTOBALANCE, + BE_AUTO_BALANCE, ]) # BE GROUP diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 266b8412707c6e848d465d477dba472c96706a16..8d31219c2e44778ce20bef441238f4bf11025511 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -201,6 +201,7 @@ def ListInstances(opts, args): "hvparams": "Hypervisor_parameters", "be/memory": "Configured_memory", "be/vcpus": "VCPUs", + "be/auto_balance": "Auto_balance", } else: headers = None