[pve-devel] [PATCH cluster v2 2/2] pvecm delnode: prevent deleting current node

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jun 13 09:25:34 CEST 2017


Else corosync really delete himself from the cluster which pmxcfs
cannot really handle and this is a bad idea in general.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

changes v1 -> v2:
* none

 data/PVE/CLI/pvecm.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index c5622c5..797aeb9 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -441,6 +441,9 @@ __PACKAGE__->register_method ({
 	die "Node/IP: $param->{node} is not a known host of the cluster.\n"
 		if !defined($node);
 
+	my $our_nodename = PVE::INotify::nodename();
+	die "Cannot delete myself from cluster!\n" if $node eq $our_nodename;
+
 	delete $nodelist->{$node};
 
 	PVE::Corosync::update_nodelist($conf, $nodelist);
-- 
2.11.0





More information about the pve-devel mailing list