From 1962f38d67403591c5f60e23fd8f7aa22afc7fee Mon Sep 17 00:00:00 2001 From: TechHome Date: Mon, 13 Apr 2020 23:11:20 +0200 Subject: [PATCH] Create leave-cluster.sh Leaving a created cluster in Proxmox 6.1-8 --- leave-cluster.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 leave-cluster.sh diff --git a/leave-cluster.sh b/leave-cluster.sh new file mode 100644 index 0000000..6171c82 --- /dev/null +++ b/leave-cluster.sh @@ -0,0 +1,30 @@ +#SSH into proxmox cluster node +#1. Shutdown all containers and vms +pvesh create /nodes/localhost/stopall + + +#2. stop services +systemctl stop pvestatd.service +systemctl stop pvedaemon.service +systemctl stop pve-cluster.service +systemctl stop corosync +systemctl stop pve-cluster + + +#3. edit through sqlite, check, delete, verify +sqlite3 /var/lib/pve-cluster/config.db +sqlite> select * from tree where name = 'corosync.conf'; +sqlite> delete from tree where name = 'corosync.conf'; +sqlite> select * from tree where name = 'corosync.conf'; +sqlite> .quit + + +#3. Remove directories +pmxcfs -l +rm /etc/pve/corosync.conf +rm /etc/corosync/* +rm /var/lib/corosync/* +#rm -rf /etc/pve/nodes/* #Do this only if you want to delete all nodes + +#Dont forget to remove nodes that you dont want from /etc/pve/priv/authorized_keys +reboot