Skip to main content

How to reset cluster configuration in Proxmox 2

If you have already made the proxmox cluster, but you want to make changes to the cluster config, for example for changing the hostname of the node, or the network with which the nodes are communicating on in the cluster, you can remove the cluster and create it again:

First, make a backup of the cluster:

cp -a /etc/pve /root/pve_backup

Stop cluster service:

/etc/init.d/pve-cluster stop

Umount /etc/pve if it is mounted:

umount /etc/pve

Stop corosync service:

/etc/init.d/cman stop

Remove cluster configuration:

# rm /etc/cluster/cluster.conf
# rm -rf /var/lib/pve-cluster/*

Start again cluster service:

/etc/init.d/pve-cluster start

Now, you can create new cluster:

# pvecm create newcluster 

Restore cluster and virtual machines configuration from the backup:

# cp /root/pve_backup/*.cfg /etc/pve/
# cp /root/pve_backup/qemu-server/*.conf /etc/pve/qemu-server/
# cp /root/pve_backup/openvz/* /etc/pve/openvz/

UPDATE: This post is also valid to change the hostname of a node in a cluster or to move a node between two clusters. When you have removed a node from the cluster, it still appears in the proxmox nodes tree, to remove it from the tree you have to delete the node directory from another node in the cluster:

# rm -rf /etc/pve/nodes/HOSTNAME

14 thoughts to “How to reset cluster configuration in Proxmox 2”

  1. I just wanted to add a comment that with a few modifications, you can also move a node from one cluster to another.

    rsync -av /etc/pve/ /root/pve_backup/
    /etc/init.d/pve-cluster stop
    umount /etc/pve
    /etc/init.d/cman stop
    rm /etc/cluster/cluster.conf
    rm -rf /var/lib/pve-cluster/*
    /etc/init.d/pve-cluster start
    pvecm add HOST_IN_CLUSTER_ADDING_TO
    cp /root/pve_backup/qemu-server/*.conf /etc/pve/qemu-server/
    cp /root/pve_backup/openvz/* /etc/pve/openvz/

    On any server in the “migrated_from” cluster:

    pvecm delnode NODENAME

    This causes it disappear from the inventory, but it still shows up in the node tree on the left hand side. To get rid of that:

    mkdir /root/removed_pve #save a backup!
    mv /etc/pve/nodes/NODENAME /root/removed_pve

    It will almost instantly remove from the left hand tree.

  2. Thanks tons! There’s a lot of ProxMox docs, but only a handful are useful. Thanks again!

  3. How about an update (if needed) for Proxmox version 3.X
    THANKS!! This is great! I just created a cluster of two machines and want to ‘remove’ a container, which refuses to remove. I’m in deep! Ric

  4. FYI, the web interface may not work after doing this. I would login, then get redirected back to the login window.

    running this fixed it:
    /etc/init.d/pve-manager restart

  5. Thanks a lot for this, this is so simple that I don’t get why proxmox.com says that this is “not supported”, and that the only way is to reinstall a node …

Leave a Reply

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

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.