Revision 91ae95fd
b/lib/backend.py | ||
---|---|---|
375 | 375 |
|
376 | 376 |
@RunLocalHooks(constants.FAKE_OP_MASTER_TURNDOWN, "master-ip-turndown", |
377 | 377 |
_BuildMasterIpEnv) |
378 |
def DeactivateMasterIp(master_ip, master_netmask, master_netdev): |
|
378 |
def DeactivateMasterIp(master_ip, master_netmask, master_netdev, family):
|
|
379 | 379 |
"""Deactivate the master IP on this node. |
380 | 380 |
|
381 | 381 |
@param master_ip: the master IP |
382 | 382 |
@param master_netmask: the master IP netmask |
383 | 383 |
@param master_netdev: the master network device |
384 |
@param family: the IP family |
|
384 | 385 |
|
385 | 386 |
""" |
387 |
# pylint: disable=W0613 |
|
386 | 388 |
# TODO: log and report back to the caller the error failures; we |
387 | 389 |
# need to decide in which case we fail the RPC for this |
388 | 390 |
|
b/lib/bootstrap.py | ||
---|---|---|
567 | 567 |
modify_ssh_setup = cfg.GetClusterInfo().modify_ssh_setup |
568 | 568 |
runner = rpc.BootstrapRunner() |
569 | 569 |
|
570 |
(_, ip, netdev, netmask, _) = cfg.GetMasterNetworkParameters() |
|
571 |
result = runner.call_node_deactivate_master_ip(master, ip, netmask, netdev) |
|
570 |
(_, ip, netdev, netmask, family) = cfg.GetMasterNetworkParameters() |
|
571 |
result = runner.call_node_deactivate_master_ip(master, ip, netmask, netdev, |
|
572 |
family) |
|
572 | 573 |
msg = result.fail_msg |
573 | 574 |
if msg: |
574 | 575 |
logging.warning("Could not disable the master IP: %s", msg) |
... | ... | |
707 | 708 |
logging.info("Stopping the master daemon on node %s", old_master) |
708 | 709 |
|
709 | 710 |
runner = rpc.BootstrapRunner() |
710 |
(_, ip, netdev, netmask, _) = cfg.GetMasterNetworkParameters()
|
|
711 |
(_, ip, netdev, netmask, family) = cfg.GetMasterNetworkParameters()
|
|
711 | 712 |
result = runner.call_node_deactivate_master_ip(old_master, ip, netmask, |
712 |
netdev) |
|
713 |
netdev, family)
|
|
713 | 714 |
msg = result.fail_msg |
714 | 715 |
if msg: |
715 | 716 |
logging.warning("Could not disable the master IP: %s", msg) |
b/lib/cmdlib.py | ||
---|---|---|
1355 | 1355 |
"""Destroys the cluster. |
1356 | 1356 |
|
1357 | 1357 |
""" |
1358 |
(master, ip, dev, netmask, _) = self.cfg.GetMasterNetworkParameters()
|
|
1358 |
(master, ip, dev, netmask, family) = self.cfg.GetMasterNetworkParameters()
|
|
1359 | 1359 |
|
1360 | 1360 |
# Run post hooks on master node before it's removed |
1361 | 1361 |
_RunPostHook(self, master) |
1362 | 1362 |
|
1363 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev) |
|
1363 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev, |
|
1364 |
family) |
|
1364 | 1365 |
result.Raise("Could not disable the master role") |
1365 | 1366 |
|
1366 | 1367 |
return master |
... | ... | |
3327 | 3328 |
|
3328 | 3329 |
# shutdown the master IP |
3329 | 3330 |
(master, ip, dev, netmask, family) = self.cfg.GetMasterNetworkParameters() |
3330 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev) |
|
3331 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev, |
|
3332 |
family) |
|
3331 | 3333 |
result.Raise("Could not disable the master role") |
3332 | 3334 |
|
3333 | 3335 |
try: |
... | ... | |
3700 | 3702 |
helper_os("blacklisted_os", self.op.blacklisted_os, "blacklisted") |
3701 | 3703 |
|
3702 | 3704 |
if self.op.master_netdev: |
3703 |
(master, ip, dev, netmask, _) = self.cfg.GetMasterNetworkParameters()
|
|
3705 |
(master, ip, dev, netmask, family) = self.cfg.GetMasterNetworkParameters()
|
|
3704 | 3706 |
feedback_fn("Shutting down master ip on the current netdev (%s)" % |
3705 | 3707 |
self.cluster.master_netdev) |
3706 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev) |
|
3708 |
result = self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev, |
|
3709 |
family) |
|
3707 | 3710 |
result.Raise("Could not disable the master ip") |
3708 | 3711 |
feedback_fn("Changing master_netdev from %s to %s" % |
3709 | 3712 |
(dev, self.op.master_netdev)) |
... | ... | |
3903 | 3906 |
"""Deactivate the master IP. |
3904 | 3907 |
|
3905 | 3908 |
""" |
3906 |
(master, ip, dev, netmask, _) = self.cfg.GetMasterNetworkParameters()
|
|
3907 |
self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev) |
|
3909 |
(master, ip, dev, netmask, family) = self.cfg.GetMasterNetworkParameters()
|
|
3910 |
self.rpc.call_node_deactivate_master_ip(master, ip, netmask, dev, family)
|
|
3908 | 3911 |
|
3909 | 3912 |
|
3910 | 3913 |
def _WaitForSync(lu, instance, disks=None, oneshot=False): |
b/lib/rpc_defs.py | ||
---|---|---|
411 | 411 |
("master_ip", None, "The master IP"), |
412 | 412 |
("master_netmask", None, "The master IP netmask"), |
413 | 413 |
("master_netdev", None, "The master network device"), |
414 |
("ip_family", None, "The cluster IP family"), |
|
414 | 415 |
], None, |
415 | 416 |
"Deactivates master IP on a node"), |
416 | 417 |
("node_change_master_netmask", SINGLE, TMO_FAST, [ |
b/lib/server/noded.py | ||
---|---|---|
704 | 704 |
"""Deactivate the master IP on this node. |
705 | 705 |
|
706 | 706 |
""" |
707 |
return backend.DeactivateMasterIp(params[0], params[1], params[2]) |
|
707 |
return backend.DeactivateMasterIp(params[0], params[1], params[2], |
|
708 |
params[3]) |
|
708 | 709 |
|
709 | 710 |
@staticmethod |
710 | 711 |
def perspective_node_stop_master(params): |
Also available in: Unified diff