Skip to content

Proxmox Cluster

First PublishedLast UpdatedByAtif Alam

First page of the HA Kubernetes on Two Proxmox Hosts series. This page takes two bare machines to a quorate 2-node Proxmox cluster. The six Kubernetes VMs are the next page.

  • Proxmox VE 9.x ISO flashed to a USB stick.
  • The IP plan from the hub page finalized: static IPs reserved for both hosts, the tiebreaker box, all six VMs, and the API VIP (outside the DHCP pool).
  • The tiebreaker box reachable on the same subnet, with apt and Docker available.

Install Proxmox VE normally on each host. For this lab, choose ZFS on the single NVMe so the default VM datastore is local-zfs (pages 2 and Automate use that id). An existing host that already uses LVM thin can keep local-lvm and substitute that datastore id later. During or right after install:

  • Set the planned static IP and a unique hostname per host.
  • Point both hosts at the same NTP source — etcd and corosync both misbehave under clock skew.

If Proxmox is already installed, skip the ISO and start at Update an Existing Install.

On each host, record the running version before changing packages:

Terminal window
pveversion
  • pve-manager/9. — point-release update. Switch repositories in the next section, then run Apply the Package Update. A default install uses the enterprise repository, and apt update fails there without a subscription key.
  • pve-manager/8. — major upgrade to Proxmox VE 9 (Debian 13). Use Upgrade from Proxmox VE 8 below, then skip Switch to No-Subscription Repos. That upgrade already leaves the no-subscription repository in place.

Update one host at a time if the two machines are already clustered. Shut down running guests before any reboot. This lab’s six VMs do not exist yet.

This replaces Debian 12 (bookworm) with Debian 13 (trixie). Proxmox’s checklist is Upgrade from 8 to 9. Run the upgrade from SSH or a physical console. The browser shell drops while services restart. On SSH, start tmux first so a dropped connection does not kill apt.

If ceph —version shows a Ceph cluster on this host, stop. This lab does not run Ceph, and a Ceph host has extra upgrade steps in that guide.

Confirm at least Proxmox VE 8.4.1 and 5 GB free on / (10 GB is safer):

Terminal window
pveversion
df -h /

If pve-manager is older than 8.4.1, move to the latest 8.4 packages first, then reboot and check pveversion again:

Terminal window
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/ceph.list 2>/dev/null || true
apt update
apt full-upgrade
reboot

Run the checklist. It only reports; it does not change the host. Clear every failure it prints, then run it again:

Terminal window
pve8to9 --full

Do not start the trixie upgrade while pve8to9 —full still reports failures, or while apt update prints errors.

Switch Debian to trixie, disable the enterprise repositories, and add the Proxmox VE 9 no-subscription repository:

Terminal window
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list 2>/dev/null || true
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/ceph.list 2>/dev/null || true
cat > /etc/apt/sources.list.d/proxmox.sources << 'EOF'
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
rm -f /etc/apt/sources.list.d/pve-no-subscription.list /etc/apt/sources.list.d/pve-install-repo.list
grep -R bookworm /etc/apt/sources.list /etc/apt/sources.list.d/ || true

grep should print nothing that is still an active deb line. Comment out any remaining bookworm entry before continuing.

Terminal window
apt update
apt full-upgrade
pve8to9 --full
reboot

If apt asks about a changed configuration file, keep the currently installed file when you know you edited it; otherwise take the package maintainer’s version. Allow service restarts when asked. After SSH returns:

Terminal window
pveversion
uname -r

Expected: pve-manager/9. Continue at Hide the Subscription Nag.

Use this on a fresh Proxmox VE 9 install and on a host that is already on 9. Hosts upgraded from 8 in the previous section already have this repository; skip ahead to the nag popup.

On each host, disable the enterprise repositories (they reject apt without a subscription key) and enable the no-subscription repository. Enabled: no has to stay on the same entry as Types:; a blank line starts a second entry, which makes apt update fail with a malformed source.

Terminal window
for f in /etc/apt/sources.list.d/pve-enterprise.sources /etc/apt/sources.list.d/ceph.sources; do
[ -f "$f" ] || continue
sed -i -e '/^Enabled:/d' -e '/^[[:space:]]*$/d' "$f"
printf 'Enabled: no\n' >> "$f"
done
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list 2>/dev/null || true
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/ceph.list 2>/dev/null || true
cat > /etc/apt/sources.list.d/proxmox.sources << 'EOF'
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

The Ceph enterprise repository is disabled so apt update can succeed without a subscription. This lab does not use Ceph. Leave ceph.sources enabled if this host is actually a Ceph node.

On each host that is already on Proxmox VE 9 (fresh install or an existing 9.x host), after the repository switch:

Terminal window
apt update
apt full-upgrade -y
reboot

Use apt full-upgrade. apt upgrade will not remove a package when a new dependency requires it, and Proxmox updates sometimes need that removal.

After the host is back:

Terminal window
pveversion
uname -r

Expected: pve-manager/9. at or above the version you recorded. When a kernel package was part of the upgrade, uname -r matches that new kernel.

Cosmetic. On pve-manager 9.2.27 the dialog still comes from checked_command in proxmox-widget-toolkit 5.2.13 (proxmoxlib.js). That file no longer contains data.status !== 'Active'. Run this on each host whose web UI you open, from SSH. Restarting pveproxy drops the browser shell.

The login page loads /proxmoxlib.js?ver= plus the first line of that file. Patching the function and leaving that line unchanged lets the browser keep the old script, so the dialog stays. The last command changes the first line so the next login fetches the patched file:

Terminal window
f=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
grep -q 'orig_cmd(); return;' "$f" || sed -i.bak 's/checked_command: function (orig_cmd) {$/& orig_cmd(); return;/' "$f"
head -1 "$f" | grep -q -- '-nosub$' || sed -i '1s|$|-nosub|' "$f"
systemctl restart pveproxy.service
grep -n 'checked_command: function' "$f"
head -1 "$f"

The function line must contain orig_cmd(); return;, and the first line must end in -nosub. Then log in again. A count of 0 means this file’s function line does not match; stop and do not edit further. A proxmox-widget-toolkit update restores the original file, so run the command again after that update.

Step 2: Form the 2-Node Cluster and Add the QDevice

Section titled “Step 2: Form the 2-Node Cluster and Add the QDevice”

A 2-node cluster cannot form quorum alone, so a QDevice on the tiebreaker box provides the third vote. This is Proxmox-level quorum (corosync), independent of the Kubernetes/etcd quorum built later.

On Host A, pvecm create starts a new Proxmox cluster and names it homelab-cluster. This host becomes the first member. Host B joins that cluster in the next command.

Terminal window
pvecm create homelab-cluster

Log in to Host A’s web UI at https://<HOST-A-IP>:8006. The left tree root shows Datacenter (homelab-cluster). Click Datacenter, then Cluster, for the cluster name and the node list. Log out and back in if the name is still just Datacenter — the tree reads it at login. Host B appears in that list after the join.

On Host B, join the cluster on Host A. <HOST-A-IP> is Host A’s address on vmbr0 — the link pvecm create bound. On Host A, read it with:

Terminal window
ip -4 -br addr show vmbr0

Use the address before the /. The same address is on the hub network plan and in the web UI: select the Host A node, then System → Network, and read vmbr0.

Terminal window
pvecm add <HOST-A-IP>

Verify both hosts see each other:

Terminal window
pvecm status

Expected: 2 nodes listed.

A 2-node cluster needs one more vote so it stays quorate when either host is down. That vote is corosync-qnetd on a machine that is not a VM on either cluster host. Debian, Ubuntu, and Raspberry Pi OS all work. Run setup once, from one Proxmox host. It enables corosync-qdevice on both members.

On the tiebreaker:

Terminal window
apt update
apt install corosync-qnetd
systemctl enable --now corosync-qnetd
systemctl is-active corosync-qnetd
ss -lnt | grep 5403

Expected: active, and a listener on TCP 5403. Both Proxmox hosts must be able to reach that port.

On both Proxmox hosts:

Terminal window
apt install corosync-qdevice

pvecm qdevice setup logs into the tiebreaker as root, using this Proxmox host’s /root/.ssh/id_rsa. On Debian, enter the root password when asked, or install that public key first. Ubuntu and Raspberry Pi OS have no root SSH login until you set a root password or a key for this one command. Afterward, set PermitRootLogin prohibit-password.

From one Proxmox host:

Terminal window
pvecm qdevice setup <TIEBREAKER-IP>

Read the output through Done. A run that stops earlier does not change the vote count. Then:

Terminal window
pvecm status

Expected: Expected votes: 3, Total votes: 3, Flags: Quorate Qdevice, a membership row 0x00000000 1 Qdevice, and A,V,NMW on both nodes. The other Proxmox host already has corosync-qdevice enabled. Do not run setup there.

On the tiebreaker:

Terminal window
corosync-qnetd-tool -l

Expected: homelab-cluster with both Proxmox nodes connected.

Keep etcd3 and the NFS share on the NAS. A normal Debian host is the better place for corosync-qnetd. An appliance such as UGOS has apt, and the commands below are what it takes to make pvecm qdevice setup finish there. Run every pvecm command on a Proxmox host. The NAS does not have pvecm.

On the NAS:

Terminal window
apt update
apt install corosync-qnetd

Unable to locate package corosync-qnetd means Debian main is missing from this box. Check /etc/apt/sources.list before adding another file. UGOS already lists bookworm there, so a second copy only warns configured multiple times. If /etc/apt/sources.list.d/debian-main.list is already there, remove it:

Terminal window
rm -f /etc/apt/sources.list.d/debian-main.list
apt update

Unmet dependencies on that same NAS comes from packages already broken on the box, not from corosync-qnetd itself. Install only the packages named in the error. On a UGOS install where ctdb, picom, and vim were already broken, that set was:

Terminal window
apt install corosync-qnetd libnss3-tools time libconfig9 libxcb-damage0 libxcb-image0 libxcb-render-util0 libxcb-xinerama0 vim-runtime

Do not run apt full-upgrade or apt —fix-broken install on the NAS.

Debian leaves the daemon stopped after install. Start it and confirm TCP 5403:

Terminal window
systemctl enable --now corosync-qnetd
dpkg -s corosync-qnetd | grep -E '^(Status|Version):'
systemctl is-active corosync-qnetd
ss -lnt | grep 5403

Expected: Status: install ok installed, active, and a listener on 0.0.0.0:5403 or *:5403. No cluster is listed yet. That appears only after setup.

pvecm qdevice setup always SSHs to root@<TIEBREAKER-IP> with the Proxmox host’s /root/.ssh/id_rsa. It cannot use the account you log in with.

On the Proxmox host, print the public key:

Terminal window
cat /root/.ssh/id_rsa.pub

On the NAS, in a root shell (sudo -i from your login user if that is how you get one), put that one line in root’s authorized keys:

Terminal window
mkdir -p /root/.ssh
chmod 700 /root/.ssh
echo 'PASTE_THE_PUBKEY_LINE_HERE' >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
printf 'PermitRootLogin prohibit-password\n' > /etc/ssh/sshd_config.d/99-proxmox-qdevice.conf
systemctl reload ssh || systemctl reload sshd
sshd -T | grep permitrootlogin

Expected: permitrootlogin prohibit-password. Back on the same Proxmox host, this must print ok without a password:

Terminal window
ssh -o BatchMode=yes root@<TIEBREAKER-IP> echo ok
pvecm qdevice setup <TIEBREAKER-IP>

Read the output through Done. A run that stops earlier does not change the vote count. The second Proxmox host does not need its key on the NAS. Quorum uses TCP 5403 after this.

Certificate database already exists followed by qnetd-cacert.crt: No such file or directory means the NAS database is missing the CA file pvecm copies. pvecm will not create that file while /etc/corosync/qnetd/nssdb is already there.

If that directory was deleted, do not start the daemon yet. It exits with Can't open NSS DB directory. Recreate the database, give it to coroqnetd, then start it. certutil run as root leaves the directory owned by root, and the next start is Permission denied until the chown:

Terminal window
corosync-qnetd-certutil -i
chown -R coroqnetd:coroqnetd /etc/corosync/qnetd/nssdb
systemctl start corosync-qnetd

When the database already exists and only qnetd-cacert.crt is missing, export the CA instead of deleting the directory. On the NAS, as root:

Terminal window
chmod 755 /etc/corosync/qnetd /etc/corosync/qnetd/nssdb
certutil -L -d sql:/etc/corosync/qnetd/nssdb -n "QNet CA" -f /etc/corosync/qnetd/nssdb/pwdfile.txt > /etc/corosync/qnetd/nssdb/qnetd-cacert.crt
certutil -L -d sql:/etc/corosync/qnetd/nssdb -n "QNet CA" -a -f /etc/corosync/qnetd/nssdb/pwdfile.txt >> /etc/corosync/qnetd/nssdb/qnetd-cacert.crt
chown -R coroqnetd:coroqnetd /etc/corosync/qnetd/nssdb
chmod 644 /etc/corosync/qnetd/nssdb/qnetd-cacert.crt
systemctl restart corosync-qnetd

ls -la /etc/corosync/qnetd/nssdb/qnetd-cacert.crt must show a non-empty file owned by coroqnetd. Run pvecm qdevice setup again on the same Proxmox host.

--force 1 only when that command says the Proxmox node certificate store is already initialised. It deletes /etc/corosync/qdevice/net/nssdb on the Proxmox nodes. It does not repair the NAS database:

Terminal window
pvecm qdevice setup <TIEBREAKER-IP> --force 1

If ls on the NAS shows qnetd-cacert.crt and pvecm still reports No such file or directory for that path, the NAS shell can see the file and scp cannot. Stay on the Proxmox host. pvecm resets PATH and runs /usr/bin/scp, so a wrapper in /root/bin or /usr/local/bin never runs. If one of those was created on the NAS, remove it there (pvecm is not installed on the NAS):

Terminal window
rm -f /root/bin/scp /usr/local/bin/scp
rmdir /root/bin 2>/dev/null || true

Replace /usr/bin/scp on the Proxmox host that runs pvecm, not on the NAS. Put the original binary back after pvecm status shows 3 votes.

On that Proxmox host, skip the mv when /usr/bin/scp.real already exists:

[ -x /usr/bin/scp.real ] || mv /usr/bin/scp /usr/bin/scp.real
cat > /usr/bin/scp << 'EOF'
#!/bin/bash
real=/usr/bin/scp.real
filtered=()
skip=0
for a in "$@"; do
if [ "$skip" = 1 ]; then skip=0; continue; fi
case "$a" in
-O) ;;
-o) skip=1 ;;
*) filtered+=("$a") ;;
esac
done
src=${filtered[0]:-}
dst=${filtered[1]:-}
host_of() { printf '%s' "${1%%:*}" | tr -d '[]'; }
if [[ "$src" == *:* ]]; then
host=$(host_of "$src")
rpath="${src#*:}"
[ -d "$dst" ] && dst="$dst/$(basename "$rpath")"
ssh -o BatchMode=yes "$host" "cat $(printf '%q' "$rpath")" > "$dst"
elif [[ "$dst" == *:* ]]; then
host=$(host_of "$dst")
rpath="${dst#*:}"
if ssh -o BatchMode=yes "$host" "test -d $(printf '%q' "$rpath")"; then
rpath="$rpath/$(basename "$src")"
fi
ssh -o BatchMode=yes "$host" "cat > $(printf '%q' "$rpath")" < "$src"
else
exec "$real" "$@"
fi
EOF
chmod 755 /usr/bin/scp
head -2 /usr/bin/scp

head must show #!/bin/bash and real=/usr/bin/scp.real. A truncated paste leaves the real scp in place and the error does not change. Then:

Terminal window
pvecm qdevice setup <TIEBREAKER-IP>

If it says QDevice certificate store already initialised, repeat it with --force 1. After pvecm status shows Total votes: 3, put the original copy command back:

Terminal window
mv /usr/bin/scp.real /usr/bin/scp

The other Proxmox host already has corosync-qdevice enabled. Do not run setup there. On the NAS, corosync-qnetd-tool -l lists homelab-cluster with both nodes connected.

On either Proxmox host:

Terminal window
pvecm status

Expected: Expected votes: 3, Total votes: 3, Flags: Quorate Qdevice.

Next: Provision the Six VMs.