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

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jun 9 13:16:50 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>
---
 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 d8ce424..deea1e1 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -442,4 +442,7 @@ __PACKAGE__->register_method ({
 		if !defined($node);
 
+	my $our_nodename = PVE::INotify::nodename();
+	die "Cannot delete myself from cluster!\n" if $node eq $our_nodename;
+
 	delete $nodelist->{$node};
 
-- 
2.11.0





More information about the pve-devel mailing list