if opts.drbd_storage and not opts.drbd_helper:
drbd_helper = constants.DEFAULT_DRBD_HELPER
+ master_netdev = opts.master_netdev
+ if master_netdev is None:
+ master_netdev = constants.DEFAULT_BRIDGE
+
hvlist = opts.enabled_hypervisors
if hvlist is None:
hvlist = constants.DEFAULT_ENABLED_HYPERVISOR
hvparams = dict(opts.hvparams)
beparams = opts.beparams
nicparams = opts.nicparams
- ndparams = opts.ndparams
# prepare beparams dict
beparams = objects.FillDict(constants.BEC_DEFAULTS, beparams)
utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
# prepare ndparams dict
- ndparams = objects.FillDict(constants.NDC_DEFAULTS, ndparams)
- utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
+ if opts.ndparams is None:
+ ndparams = dict(constants.NDC_DEFAULTS)
+ else:
+ ndparams = objects.FillDict(constants.NDC_DEFAULTS, opts.ndparams)
+ utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
# prepare hvparams dict
for hv in constants.HYPER_TYPES:
secondary_ip=opts.secondary_ip,
vg_name=vg_name,
mac_prefix=opts.mac_prefix,
- master_netdev=opts.master_netdev,
+ master_netdev=master_netdev,
file_storage_dir=opts.file_storage_dir,
enabled_hypervisors=hvlist,
hvparams=hvparams,
primary_ip_version=primary_ip_version,
prealloc_wipe_disks=opts.prealloc_wipe_disks,
)
- op = opcodes.OpPostInitCluster()
+ op = opcodes.OpClusterPostInit()
SubmitOpCode(op, opts=opts)
return 0
" destroy this cluster, supply the --yes-do-it option.")
return 1
- op = opcodes.OpDestroyCluster()
+ op = opcodes.OpClusterDestroy()
master = SubmitOpCode(op, opts=opts)
# if we reached this, the opcode didn't fail; we can proceed to
# shutdown all the daemons
if not AskUser(usertext):
return 1
- op = opcodes.OpRenameCluster(name=new_name)
+ op = opcodes.OpClusterRename(name=new_name)
result = SubmitOpCode(op, opts=opts, cl=cl)
if result:
@return: the desired exit code
"""
- op = opcodes.OpRedistributeConfig()
+ op = opcodes.OpClusterRedistConf()
SubmitOrSend(op, opts)
return 0
ToStdout(" - primary ip version: %d", result["primary_ip_version"])
ToStdout(" - preallocation wipe disks: %s", result["prealloc_wipe_disks"])
+ ToStdout("Default node parameters:")
+ _PrintGroupedParams(result["ndparams"], roman=opts.roman_integers)
+
ToStdout("Default instance parameters:")
_PrintGroupedParams(result["beparams"], roman=opts.roman_integers)
skip_checks = []
if opts.skip_nplusone_mem:
skip_checks.append(constants.VERIFY_NPLUSONE_MEM)
- op = opcodes.OpVerifyCluster(skip_checks=skip_checks,
+ op = opcodes.OpClusterVerify(skip_checks=skip_checks,
verbose=opts.verbose,
error_codes=opts.error_codes,
debug_simulate_errors=opts.simulate_errors)
"""
cl = GetClient()
- op = opcodes.OpVerifyDisks()
+ op = opcodes.OpClusterVerifyDisks()
result = SubmitOpCode(op, opts=opts, cl=cl)
if not isinstance(result, (list, tuple)) or len(result) != 3:
- raise errors.ProgrammerError("Unknown result type for OpVerifyDisks")
+ raise errors.ProgrammerError("Unknown result type for OpClusterVerifyDisks")
bad_nodes, instances, missing = result
@return: the desired exit code
"""
- op = opcodes.OpRepairDiskSizes(instances=args)
+ op = opcodes.OpClusterRepairDiskSizes(instances=args)
SubmitOpCode(op, opts=opts)
opts.remove_uids is not None or
opts.default_iallocator is not None or
opts.reserved_lvs is not None or
+ opts.master_netdev is not None or
opts.prealloc_wipe_disks is not None):
ToStderr("Please give at least one of the parameters.")
return 1
utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
ndparams = opts.ndparams
- utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
+ if ndparams is not None:
+ utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
mnh = opts.maintain_node_health
else:
opts.reserved_lvs = utils.UnescapeAndSplit(opts.reserved_lvs, sep=",")
- op = opcodes.OpSetClusterParams(vg_name=vg_name,
+ op = opcodes.OpClusterSetParams(vg_name=vg_name,
drbd_helper=drbd_helper,
enabled_hypervisors=hvlist,
hvparams=hvparams,
remove_uids=remove_uids,
default_iallocator=opts.default_iallocator,
prealloc_wipe_disks=opts.prealloc_wipe_disks,
+ master_netdev=opts.master_netdev,
reserved_lvs=opts.reserved_lvs)
SubmitOpCode(op, opts=opts)
return 0
"{pause <timespec>|continue|info}", "Change watcher properties"),
'modify': (
SetClusterParams, ARGS_NONE,
- [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
+ [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, MASTER_NETDEV_OPT,
NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT,
NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT,