Automatically enable hail if enabled and found
authorIustin Pop <iustin@google.com>
Thu, 31 Mar 2011 10:52:52 +0000 (12:52 +0200)
committerIustin Pop <iustin@google.com>
Thu, 31 Mar 2011 13:53:56 +0000 (15:53 +0200)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/bootstrap.py
man/gnt-cluster.rst

index 04ca505..c72754e 100644 (file)
@@ -428,6 +428,12 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable-msg=R0913
       raise errors.OpPrereqError("Invalid default iallocator script '%s'"
                                  " specified" % default_iallocator,
                                  errors.ECODE_INVAL)
+  elif constants.HTOOLS:
+    # htools was enabled at build-time, we default to it
+    if utils.FindFile(constants.IALLOC_HAIL,
+                      constants.IALLOCATOR_SEARCH_PATH,
+                      os.path.isfile):
+      default_iallocator = constants.IALLOC_HAIL
 
   now = time.time()
 
index 91cd7ce..1205a95 100644 (file)
@@ -228,10 +228,6 @@ value for wiping disks prior to allocation. This increases security
 on instance level as the instance can't access untouched data from
 it's underlying storage.
 
-
-
-
-
 xen-pvm
     Xen PVM hypervisor
 
@@ -331,14 +327,16 @@ user-id pool is initialized to an empty list. An empty list means
 that the user-id pool feature is disabled.
 
 The ``-I (--default-iallocator)`` option specifies the default
-instance allocator. The instance allocator will be used for
-operations like instance creation, instance and node migration,
-etc. when no manual override is specified. If this option is not
-specified, the default instance allocator will be blank, which
-means that relevant operations will require the administrator to
-manually specify either an instance allocator, or a set of nodes.
-The default iallocator can be changed later using the **modify**
-command.
+instance allocator. The instance allocator will be used for operations
+like instance creation, instance and node migration, etc. when no
+manual override is specified. If this option is not specified and
+htools was not enabled at build time, the default instance allocator
+will be blank, which means that relevant operations will require the
+administrator to manually specify either an instance allocator, or a
+set of nodes. If the option is not specified but htools was enabled,
+the default iallocator will be **hail**(1) (assuming it can be found
+on disk). The default iallocator can be changed later using the
+**modify** command.
 
 The ``--primary-ip-version`` option specifies the IP version used
 for the primary address. Possible values are 4 and 6 for IPv4 and