Revision 6204ee71

b/lib/bootstrap.py
223 223
def InitCluster(cluster_name, mac_prefix,
224 224
                master_netdev, file_storage_dir, candidate_pool_size,
225 225
                secondary_ip=None, vg_name=None, beparams=None,
226
                nicparams=None, hvparams=None, enabled_hypervisors=None,
227
                modify_etc_hosts=True, modify_ssh_setup=True,
228
                maintain_node_health=False, drbd_helper=None,
229
                uid_pool=None, default_iallocator=None,
226
                nicparams=None, ndparams=None, hvparams=None,
227
                enabled_hypervisors=None, modify_etc_hosts=True,
228
                modify_ssh_setup=True, maintain_node_health=False,
229
                drbd_helper=None, uid_pool=None, default_iallocator=None,
230 230
                primary_ip_version=None, prealloc_wipe_disks=False):
231 231
  """Initialise the cluster.
232 232

  
......
340 340
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
341 341
  objects.NIC.CheckParameterSyntax(nicparams)
342 342

  
343
  if ndparams is not None:
344
    utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
345
  else:
346
    ndparams = dict(constants.NDC_DEFAULTS)
347

  
343 348
  # hvparams is a mapping of hypervisor->hvparams dict
344 349
  for hv_name, hv_params in hvparams.iteritems():
345 350
    utils.ForceDictType(hv_params, constants.HVS_PARAMETER_TYPES)
......
383 388
    enabled_hypervisors=enabled_hypervisors,
384 389
    beparams={constants.PP_DEFAULT: beparams},
385 390
    nicparams={constants.PP_DEFAULT: nicparams},
391
    ndparams=ndparams,
386 392
    hvparams=hvparams,
387 393
    candidate_pool_size=candidate_pool_size,
388 394
    modify_etc_hosts=modify_etc_hosts,
b/lib/client/gnt_cluster.py
87 87
  nicparams = objects.FillDict(constants.NICC_DEFAULTS, nicparams)
88 88
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
89 89

  
90
  # prepare ndparams dict
91
  if opts.ndparams is None:
92
    ndparams = dict(constants.NDC_DEFAULTS)
93
  else:
94
    ndparams = objects.FillDict(constants.NDC_DEFAULTS, opts.ndparams)
95
    utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
96

  
90 97
  # prepare hvparams dict
91 98
  for hv in constants.HYPER_TYPES:
92 99
    if hv not in hvparams:
......
123 130
                        hvparams=hvparams,
124 131
                        beparams=beparams,
125 132
                        nicparams=nicparams,
133
                        ndparams=ndparams,
126 134
                        candidate_pool_size=opts.candidate_pool_size,
127 135
                        modify_etc_hosts=opts.modify_etc_hosts,
128 136
                        modify_ssh_setup=opts.modify_ssh_setup,
......
706 714
  if not (not opts.lvm_storage or opts.vg_name or
707 715
          not opts.drbd_storage or opts.drbd_helper or
708 716
          opts.enabled_hypervisors or opts.hvparams or
709
          opts.beparams or opts.nicparams or
717
          opts.beparams or opts.nicparams or opts.ndparams or
710 718
          opts.candidate_pool_size is not None or
711 719
          opts.uid_pool is not None or
712 720
          opts.maintain_node_health is not None or
......
749 757
  nicparams = opts.nicparams
750 758
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
751 759

  
760
  ndparams = opts.ndparams
761
  if ndparams is not None:
762
    utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
752 763

  
753 764
  mnh = opts.maintain_node_health
754 765

  
......
777 788
                                  os_hvp=None,
778 789
                                  beparams=beparams,
779 790
                                  nicparams=nicparams,
791
                                  ndparams=ndparams,
780 792
                                  candidate_pool_size=opts.candidate_pool_size,
781 793
                                  maintain_node_health=mnh,
782 794
                                  uid_pool=uid_pool,
......
868 880
     NOLVM_STORAGE_OPT, NOMODIFY_ETCHOSTS_OPT, NOMODIFY_SSH_SETUP_OPT,
869 881
     SECONDARY_IP_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
870 882
     UIDPOOL_OPT, DRBD_HELPER_OPT, NODRBD_STORAGE_OPT,
871
     DEFAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT],
883
     DEFAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT,
884
     NODE_PARAMS_OPT],
872 885
    "[opts...] <cluster_name>", "Initialises a new cluster configuration"),
873 886
  'destroy': (
874 887
    DestroyCluster, ARGS_NONE, [YES_DOIT_OPT],
......
944 957
     NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
945 958
     UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT,
946 959
     NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT,
947
     DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT],
960
     DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT, NODE_PARAMS_OPT],
948 961
    "[opts...]",
949 962
    "Alters the parameters of the cluster"),
950 963
  "renew-crypto": (
b/man/gnt-cluster.rst
134 134
| [-I *default instance allocator*]
135 135
| [--primary-ip-version *version*]
136 136
| [--prealloc-wipe-disks {yes \| no}]
137
| [--node-parameters *ndparams*]
137 138
| {*clustername*}
138 139

  
139 140
This commands is only run once initially on the first node of the
......
323 324
IPv6, respectively. This option is used when resolving node names
324 325
and the cluster name.
325 326

  
327
The ``--node-parameters`` option allows you to set default node
328
parameters for the cluster. Please see **ganeti**(7) for more
329
information about supported key=value pairs.
330

  
326 331
LIST-TAGS
327 332
~~~~~~~~~
328 333

  
......
378 383
| [--prealloc-wipe-disks {yes \| no}]
379 384
| [-I *default instance allocator*]
380 385
| [--reserved-lvs=*NAMES*]
386
| [--node-parameters *ndparams*]
381 387

  
382 388
Modify the options for the cluster.
383 389

  
384
The ``--vg-name``, ``--no-lvm-storarge``,
385
``--enabled-hypervisors``, ``--hypervisor-parameters``,
386
``--backend-parameters``, ``--nic-parameters``,
387
``--maintain-node-health``, ``--prealloc-wipe-disks``,
388
``--uid-pool`` options are described in the **init** command.
390
The ``--vg-name``, ``--no-lvm-storarge``, ``--enabled-hypervisors``,
391
``--hypervisor-parameters``, ``--backend-parameters``,
392
``--nic-parameters``, ``--maintain-node-health``,
393
``--prealloc-wipe-disks``, ``--uid-pool``, ``--node-parameters`` options
394
are described in the **init** command.
389 395

  
390 396
The ``-C`` option specifies the ``candidate_pool_size`` cluster
391 397
parameter. This is the number of nodes that the master will try to

Also available in: Unified diff