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

Add a new node parameter 'offline'

This patch adds a new node parameter called offline that will be used to
mark nodes which should be touched by commands.

We also add this flag at cluster init, node add, and export it to
iallocator scripts.

Reviewed-by: ultrotter
parent 02b31f32
......@@ -221,6 +221,7 @@ def InitCluster(cluster_name, mac_prefix, def_bridge,
secondary_ip=secondary_ip,
serial_no=1,
master_candidate=True,
offline=False,
)
sscfg = InitConfig(constants.CONFIG_VERSION,
......
......@@ -1977,7 +1977,8 @@ class LUAddNode(LogicalUnit):
self.new_node = objects.Node(name=node,
primary_ip=primary_ip,
secondary_ip=secondary_ip,
master_candidate=master_candidate)
master_candidate=master_candidate,
offline=False)
def Exec(self, feedback_fn):
"""Adds the new node to the cluster.
......@@ -5914,6 +5915,7 @@ class IAllocator(object):
"primary_ip": ninfo.primary_ip,
"secondary_ip": ninfo.secondary_ip,
"total_cpus": remote_info['cpu_total'],
"offline": ninfo.offline,
}
node_results[nname] = pnr
data["nodes"] = node_results
......
......@@ -685,6 +685,7 @@ class Node(TaggableObject):
"secondary_ip",
"serial_no",
"master_candidate",
"offline",
]
......
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