From fc0fe88c00dabfbee6a7939ae0103dc0ee0b5a11 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Fri, 5 Dec 2008 02:53:21 +0000 Subject: [PATCH] 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 --- lib/bootstrap.py | 1 + lib/cmdlib.py | 4 +++- lib/objects.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap.py b/lib/bootstrap.py index e6c84d8f9..b302d2c92 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -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, diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 77b087d7a..c4f8eb4ce 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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 diff --git a/lib/objects.py b/lib/objects.py index abfeff125..63d5bec9e 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -685,6 +685,7 @@ class Node(TaggableObject): "secondary_ip", "serial_no", "master_candidate", + "offline", ] -- GitLab