Add a ‘drained’ attribute to node objects
authorIustin Pop <iustin@google.com>
Tue, 10 Feb 2009 14:45:39 +0000 (14:45 +0000)
committerIustin Pop <iustin@google.com>
Tue, 10 Feb 2009 14:45:39 +0000 (14:45 +0000)
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

lib/bootstrap.py
lib/cmdlib.py
lib/objects.py

index 048b66e..5632d39 100644 (file)
@@ -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,
index 023b706..e75ba33 100644 (file)
@@ -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.
index 0feefbe..596aab6 100644 (file)
@@ -698,6 +698,7 @@ class Node(TaggableObject):
     "serial_no",
     "master_candidate",
     "offline",
+    "drained",
     ]