X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/4b7735f913d2c5ca556098f5a33f849e667f4f16..ce73521574984c3395835e03469a681ab7612e7d:/scripts/gnt-cluster?ds=sidebyside diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index 53cb6a3..1c9134b 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -60,13 +60,14 @@ def InitCluster(opts, args): if hvlist is not None: hvlist = hvlist.split(",") else: - hvlist = [constants.DEFAULT_ENABLED_HYPERVISOR] + hvlist = [opts.default_hypervisor] # avoid an impossible situation - if opts.default_hypervisor in hvlist: - default_hypervisor = opts.default_hypervisor - else: - default_hypervisor = hvlist[0] + if opts.default_hypervisor not in hvlist: + ToStderr("The default hypervisor requested (%s) is not" + " within the enabled hypervisor list (%s)" % + (opts.default_hypervisor, hvlist)) + return 1 hvparams = opts.hvparams if hvparams: @@ -120,9 +121,11 @@ def InitCluster(opts, args): master_netdev=opts.master_netdev, file_storage_dir=opts.file_storage_dir, enabled_hypervisors=hvlist, - default_hypervisor=default_hypervisor, + default_hypervisor=opts.default_hypervisor, hvparams=hvparams, - beparams=beparams) + beparams=beparams, + candidate_pool_size=opts.candidate_pool_size, + ) return 0 @@ -569,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...] ", "Initialises a new cluster configuration"),