]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm delnode: prevent deleting current node
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Sep 2017 11:31:21 +0000 (13:31 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 21 Sep 2017 12:28:13 +0000 (14:28 +0200)
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@proxmox.com>
(cherry picked from commit a8dbb454dbb7a5b4bbff0f63ed39e4eb45328242)

data/PVE/CLI/pvecm.pm

index e33a31128b03f8e373a1f89b738faaec919da2b6..05a68e511d74b1bc0496cc3099cf3fa201870dc0 100755 (executable)
@@ -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);