Add prealloc_wipe_disks as a cluster-wide configuration variable
authorRené Nussbaumer <rn@google.com>
Tue, 12 Oct 2010 09:04:23 +0000 (11:04 +0200)
committerRené Nussbaumer <rn@google.com>
Tue, 12 Oct 2010 10:57:39 +0000 (12:57 +0200)
This is the first step for the support of wiping block devices prior
to creation of the instance.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/bootstrap.py
lib/objects.py

index 889fa71..4b45426 100644 (file)
@@ -227,7 +227,7 @@ def InitCluster(cluster_name, mac_prefix,
                 modify_etc_hosts=True, modify_ssh_setup=True,
                 maintain_node_health=False, drbd_helper=None,
                 uid_pool=None, default_iallocator=None,
-                primary_ip_version=None):
+                primary_ip_version=None, prealloc_wipe_disks=False):
   """Initialise the cluster.
 
   @type candidate_pool_size: int
@@ -394,6 +394,7 @@ def InitCluster(cluster_name, mac_prefix,
     drbd_usermode_helper=drbd_helper,
     default_iallocator=default_iallocator,
     primary_ip_family=ipcls.family,
+    prealloc_wipe_disks=prealloc_wipe_disks,
     )
   master_node_config = objects.Node(name=hostname.name,
                                     primary_ip=hostname.ip,
index 612198a..bf1b6bd 100644 (file)
@@ -1006,6 +1006,7 @@ class Cluster(TaggableObject):
     "hidden_os",
     "blacklisted_os",
     "primary_ip_family",
+    "prealloc_wipe_disks",
     ] + _TIMESTAMPS + _UUID
 
   def UpgradeConfig(self):
@@ -1082,6 +1083,9 @@ class Cluster(TaggableObject):
     if self.primary_ip_family is None:
       self.primary_ip_family = AF_INET
 
+    if self.prealloc_wipe_disks is None:
+      self.prealloc_wipe_disks = False
+
   def ToDict(self):
     """Custom function for cluster.