Commit af64c0ea authored by Iustin Pop's avatar Iustin Pop

Add a ‘drained’ attribute to node objects

This attribute will be used to prevent any allocation on the node (any
of replace-disks with new secondary this node, failover to the node,
migration to the node).

The patch adds the attribute and initializes it correctly in cluster
init and for new nodes.

Reviewed-by: imsnah
parent 33bc6f01
......@@ -245,7 +245,7 @@ def InitCluster(cluster_name, mac_prefix, def_bridge,
secondary_ip=secondary_ip,
serial_no=1,
master_candidate=True,
offline=False,
offline=False, drained=False,
)
sscfg = InitConfig(constants.CONFIG_VERSION,
......
......@@ -2094,7 +2094,7 @@ class LUAddNode(LogicalUnit):
primary_ip=primary_ip,
secondary_ip=secondary_ip,
master_candidate=master_candidate,
offline=False)
offline=False, drained=False)
def Exec(self, feedback_fn):
"""Adds the new node to the cluster.
......
......@@ -698,6 +698,7 @@ class Node(TaggableObject):
"serial_no",
"master_candidate",
"offline",
"drained",
]
......
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