Commit 81e3ab4f authored by Agata Murawska's avatar Agata Murawska
Browse files

Introduce instance policy on nodegroup level

Signed-off-by: default avatarAgata Murawska <>
Reviewed-by: default avatarIustin Pop <>
parent be499e31
......@@ -1229,6 +1229,14 @@ def _DecideSelfPromotion(lu, exceptions=None):
return mc_now < mc_should
def _CalculateGroupIPolicy(cfg, group):
"""Calculate instance policy for group.
cluster = cfg.GetClusterInfo()
return cluster.SimpleFillIPolicy(group.ipolicy)
def _CheckNicsBridgesExist(lu, target_nics, target_node):
"""Check that the brigdes needed by a list of nics exist.
......@@ -561,8 +561,11 @@ class ConfigWriter:
result.append("duplicate node group name '%s'" %
group_name = "group %s" %
_helper_ipolicy(group_name, cluster.SimpleFillIPolicy(nodegroup.ipolicy))
_helper_ispecs(group_name, cluster.SimpleFillIPolicy(nodegroup.ipolicy))
if nodegroup.ndparams:
_helper("group %s" %, "ndparams",
_helper(group_name, "ndparams",
......@@ -1257,6 +1257,7 @@ class NodeGroup(TaggableObject):
......@@ -1304,6 +1305,8 @@ class NodeGroup(TaggableObject):
self.mtime = time.time()
self.diskparams = UpgradeDiskParams(self.diskparams)
if self.ipolicy is None:
self.ipolicy = MakeEmptyIPolicy()
def FillND(self, node):
"""Return filled out ndparams for L{objects.Node}
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