Skip to content

Instantly share code, notes, and snippets.

@btamayo
Forked from ianchen06/del_cluster.sh
Last active April 30, 2024 04:27
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save btamayo/73892d7743666e4815e43fb4e2b9f3f3 to your computer and use it in GitHub Desktop.
Save btamayo/73892d7743666e4815e43fb4e2b9f3f3 to your computer and use it in GitHub Desktop.
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
killall pmxcfs
# edit through sqlite, check, delete, verify
$ sqlite3 /var/lib/pve-cluster/config.db
sqlite> select * from tree where name = 'corosync.conf';
254327|0|254329|0|1480944811|8|corosync.conf|totem {
version: 2
[...]
sqlite> delete from tree where name = 'corosync.conf';
sqlite> select * from tree where name = 'corosync.conf';
sqlite> .quit
#
killall pmxcfs
#Remove directories
pmxcfs -l
rm /etc/pve/corosync.conf
rm /etc/corosync/*
rm /var/lib/corosync/*
# OPTIONAL: Only if you want to delete nodes their configurations as well:
# rm -rf /etc/pve/nodes/*
@postnick
Copy link

I'd maybe comment out the last line as you're going to break things
This is going to remove your active nodes and delete the configuratinos.
rm -rf /etc/pve/nodes/*

@btamayo
Copy link
Author

btamayo commented Feb 1, 2023

I'd maybe comment out the last line as you're going to break things This is going to remove your active nodes and delete the configuratinos. rm -rf /etc/pve/nodes/*

Good point. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment