2589 |
2589 |
("maintain_node_health", None, ht.TMaybeBool),
|
2590 |
2590 |
("prealloc_wipe_disks", None, ht.TMaybeBool),
|
2591 |
2591 |
("nicparams", None, ht.TOr(ht.TDict, ht.TNone)),
|
|
2592 |
("ndparams", None, ht.TOr(ht.TDict, ht.TNone)),
|
2592 |
2593 |
("drbd_helper", None, ht.TOr(ht.TString, ht.TNone)),
|
2593 |
2594 |
("default_iallocator", None, ht.TOr(ht.TString, ht.TNone)),
|
2594 |
2595 |
("reserved_lvs", None, ht.TOr(ht.TListOf(ht.TNonEmptyString), ht.TNone)),
|
... | ... | |
2698 |
2699 |
utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
|
2699 |
2700 |
self.new_beparams = cluster.SimpleFillBE(self.op.beparams)
|
2700 |
2701 |
|
|
2702 |
if self.op.ndparams:
|
|
2703 |
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES)
|
|
2704 |
self.new_ndparams = cluster.SimpleFillND(self.op.ndparams)
|
|
2705 |
|
2701 |
2706 |
if self.op.nicparams:
|
2702 |
2707 |
utils.ForceDictType(self.op.nicparams, constants.NICS_PARAMETER_TYPES)
|
2703 |
2708 |
self.new_nicparams = cluster.SimpleFillNIC(self.op.nicparams)
|
... | ... | |
2851 |
2856 |
self.cluster.nicparams[constants.PP_DEFAULT] = self.new_nicparams
|
2852 |
2857 |
if self.op.osparams:
|
2853 |
2858 |
self.cluster.osparams = self.new_osp
|
|
2859 |
if self.op.ndparams:
|
|
2860 |
self.cluster.ndparams = self.new_ndparams
|
2854 |
2861 |
|
2855 |
2862 |
if self.op.candidate_pool_size is not None:
|
2856 |
2863 |
self.cluster.candidate_pool_size = self.op.candidate_pool_size
|
... | ... | |
3741 |
3748 |
("group", None, ht.TMaybeString),
|
3742 |
3749 |
("master_capable", None, ht.TMaybeBool),
|
3743 |
3750 |
("vm_capable", None, ht.TMaybeBool),
|
|
3751 |
("ndparams", None, ht.TOr(ht.TDict, ht.TNone)),
|
3744 |
3752 |
]
|
3745 |
3753 |
_NFLAGS = ["master_capable", "vm_capable"]
|
3746 |
3754 |
|
... | ... | |
3900 |
3908 |
offline=False, drained=False,
|
3901 |
3909 |
group=node_group)
|
3902 |
3910 |
|
|
3911 |
if self.op.ndparams:
|
|
3912 |
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES)
|
|
3913 |
|
3903 |
3914 |
def Exec(self, feedback_fn):
|
3904 |
3915 |
"""Adds the new node to the cluster.
|
3905 |
3916 |
|
... | ... | |
3927 |
3938 |
if new_node.master_candidate:
|
3928 |
3939 |
self.LogInfo("Node will be a master candidate")
|
3929 |
3940 |
|
|
3941 |
if self.op.ndparams:
|
|
3942 |
new_node.ndparams = self.op.ndparams
|
|
3943 |
|
3930 |
3944 |
# check connectivity
|
3931 |
3945 |
result = self.rpc.call_version([node])[node]
|
3932 |
3946 |
result.Raise("Can't get version information from node %s" % node)
|
... | ... | |
4007 |
4021 |
("master_capable", None, ht.TMaybeBool),
|
4008 |
4022 |
("vm_capable", None, ht.TMaybeBool),
|
4009 |
4023 |
("secondary_ip", None, ht.TMaybeString),
|
|
4024 |
("ndparams", None, ht.TOr(ht.TDict, ht.TNone)),
|
4010 |
4025 |
_PForce,
|
4011 |
4026 |
]
|
4012 |
4027 |
REQ_BGL = False
|
... | ... | |
4220 |
4235 |
" based ping to node daemon port",
|
4221 |
4236 |
errors.ECODE_ENVIRON)
|
4222 |
4237 |
|
|
4238 |
if self.op.ndparams:
|
|
4239 |
new_ndparams = _GetUpdatedParams(self.node.ndparams, self.op.ndparams)
|
|
4240 |
utils.ForceDictType(new_ndparams, constants.NDS_PARAMETER_TYPES)
|
|
4241 |
self.new_ndparams = new_ndparams
|
|
4242 |
|
4223 |
4243 |
def Exec(self, feedback_fn):
|
4224 |
4244 |
"""Modifies a node.
|
4225 |
4245 |
|
... | ... | |
4230 |
4250 |
|
4231 |
4251 |
result = []
|
4232 |
4252 |
|
|
4253 |
if self.op.ndparams:
|
|
4254 |
node.ndparams = self.new_ndparams
|
|
4255 |
|
4233 |
4256 |
for attr in ["master_capable", "vm_capable"]:
|
4234 |
4257 |
val = getattr(self.op, attr)
|
4235 |
4258 |
if val is not None:
|