Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lotherk
Forked from ianchen06/del_cluster.sh
Last active December 8, 2021 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lotherk/fcba1f0622638ef7647fc7e43d32d962 to your computer and use it in GitHub Desktop.
Save lotherk/fcba1f0622638ef7647fc7e43d32d962 to your computer and use it in GitHub Desktop.
delete proxmox cluster
#/bin/sh
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
set -x
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
# create update sql
cat <<EOM > /tmp/update.sql
delete from tree where name = 'corosync.conf';
.quit
EOM
# update sql
sqlite3 -echo /var/lib/pve-cluster/config.db < /tmp/update.sql
rm -f /tmp/update.sql
# remove directories
pmxcfs -l
rm /etc/pve/corosync.conf
rm /etc/corosync/*
rm /var/lib/corosync/*
rm -rf /etc/pve/nodes/*
rm /etc/pve/priv/known_hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment