Method to Delete a Cluster in PVE


Creating a cluster in PVE via the GUI is straightforward, but deleting a cluster while converting it back to a standalone node and retaining virtual machines is relatively more challenging.

After checking the official documentation, here’s a recorded solution:

You can first check how many nodes are in the cluster. In this case, there is only one:

ls /etc/pve/nodes

1. Stop Corosync and PVE cluster services on the node

systemctl stop pve-cluster

systemctl stop corosync

2. Restart the cluster file system in local mode

pmxcfs -l

3. Remove Corosync configuration files

rm /etc/pve/corosync.conf

rm -r /etc/corosync/*

4. Restart the file system as a normal service

killall pmxcfs

systemctl start pve-cluster

At this point, when you check in the GUI, you will see that the cluster is gone.

5. The node is now separated from the cluster. You can use the following command to remove it from any remaining nodes in the cluster:

pvecm delnode oldNodeName

6. If the command fails due to quorum loss in the remaining nodes, you can set `expected` to 1 as a workaround and then repeat the `pvecm delnode` command:

pvecm expected 1

pvecm delnode oldNodeName

7. Now switch back to the separated node and remove all remaining cluster files from it. This ensures the node can be added to another cluster without issues. If the configuration files of other nodes are still present in the cluster file system, you may also need to clean them. After verifying the correct node name, you can simply delete the entire directory recursively under `/etc/pve/nodes/NODENAME`.

rm /var/lib/corosync/*

ls /etc/pve/nodes  # Print the node names

pvecm delnode nodeName

rm -rf /etc/pve/nodes/nodeName


Leave a Reply

Your email address will not be published. Required fields are marked *