Commit ce735215 authored by Guido Trotter's avatar Guido Trotter

gnt-cluster init, handle candidate_pool_size

- Add a new command line option, defaulting to the constant value
- Pass the value to bootstrap.InitCluster
- Use it to init the new Cluster object

Reviewed-by: imsnah
parent c3e618cc
......@@ -97,13 +97,16 @@ def _InitGanetiServerSetup():
def InitCluster(cluster_name, mac_prefix, def_bridge,
master_netdev, file_storage_dir,
secondary_ip=None,
vg_name=None, beparams=None, hvparams=None,
master_netdev, file_storage_dir, candidate_pool_size,
secondary_ip=None, vg_name=None, beparams=None, hvparams=None,
enabled_hypervisors=None, default_hypervisor=None):
"""Initialise the cluster.
@type candidate_pool_size: int
@param candidate_pool_size: master candidate pool size
"""
# TODO: complete the docstring
if config.ConfigWriter.IsCluster():
raise errors.OpPrereqError("Cluster is already initialised")
......@@ -211,6 +214,7 @@ def InitCluster(cluster_name, mac_prefix, def_bridge,
default_hypervisor=default_hypervisor,
beparams={constants.BEGR_DEFAULT: beparams},
hvparams=hvparams,
candidate_pool_size=candidate_pool_size,
)
master_node_config = objects.Node(name=hostname.name,
primary_ip=hostname.ip,
......
......@@ -123,7 +123,9 @@ def InitCluster(opts, args):
enabled_hypervisors=hvlist,
default_hypervisor=opts.default_hypervisor,
hvparams=hvparams,
beparams=beparams)
beparams=beparams,
candidate_pool_size=opts.candidate_pool_size,
)
return 0
......@@ -570,6 +572,10 @@ commands = {
keyval_option("-B", "--backend-parameters", dest="beparams",
type="keyval", default={},
help="Backend parameters"),
make_option("-C", "--candidate-pool-size",
default=constants.MASTER_POOL_SIZE_DEFAULT,
help="Set the candidate pool size",
dest="candidate_pool_size", type="int"),
],
"[opts...] <cluster_name>",
"Initialises a new cluster configuration"),
......
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