[pve-devel] [PATCH cluster 1/4] pvecm delnode: prevent deleting current node
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Sep 21 13:31:21 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>
(cherry picked from commit a8dbb454dbb7a5b4bbff0f63ed39e4eb45328242)
---
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 e33a311..05a68e5 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -438,6 +438,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::Cluster::corosync_update_nodelist($conf, $nodelist);
--
2.11.0
More information about the pve-devel
mailing list