Proxmox Cluster
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.
Prerequisites
Section titled “Prerequisites”- 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
aptand Docker available.
Step 1: Install Proxmox on Both Hosts
Section titled “Step 1: Install Proxmox on Both Hosts”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.
Update an Existing Install
Section titled “Update an Existing Install”On each host, record the running version before changing packages:
pveversionpve-manager/9.— point-release update. Switch repositories in the next section, then run Apply the Package Update. A default install uses the enterprise repository, andapt updatefails 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.
Upgrade from Proxmox VE 8
Section titled “Upgrade from Proxmox VE 8”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):
pveversiondf -h /If pve-manager is older than 8.4.1, move to the latest 8.4 packages first, then reboot and check pveversion again:
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.listecho "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.listsed -i 's/^deb/#deb/' /etc/apt/sources.list.d/ceph.list 2>/dev/null || trueapt updateapt full-upgraderebootRun the checklist. It only reports; it does not change the host. Clear every failure it prints, then run it again:
pve8to9 --fullDo 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:
sed -i 's/bookworm/trixie/g' /etc/apt/sources.listsed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list 2>/dev/null || truesed -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: debURIs: http://download.proxmox.com/debian/pveSuites: trixieComponents: pve-no-subscriptionSigned-By: /usr/share/keyrings/proxmox-archive-keyring.gpgEOF
rm -f /etc/apt/sources.list.d/pve-no-subscription.list /etc/apt/sources.list.d/pve-install-repo.listgrep -R bookworm /etc/apt/sources.list /etc/apt/sources.list.d/ || truegrep should print nothing that is still an active deb line. Comment out any remaining bookworm entry before continuing.
apt updateapt full-upgradepve8to9 --fullrebootIf 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:
pveversionuname -rExpected: pve-manager/9. Continue at Hide the Subscription Nag.
Switch to No-Subscription Repos
Section titled “Switch to No-Subscription Repos”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.
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"donesed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list 2>/dev/null || truesed -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: debURIs: http://download.proxmox.com/debian/pveSuites: trixieComponents: pve-no-subscriptionSigned-By: /usr/share/keyrings/proxmox-archive-keyring.gpgEOFThe 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.
Apply the Package Update
Section titled “Apply the Package Update”On each host that is already on Proxmox VE 9 (fresh install or an existing 9.x host), after the repository switch:
apt updateapt full-upgrade -yrebootUse 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:
pveversionuname -rExpected: 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.
Hide the Subscription Nag
Section titled “Hide the Subscription Nag”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:
f=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.jsgrep -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.servicegrep -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.
pvecm create homelab-clusterLog 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:
ip -4 -br addr show vmbr0Use 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.
pvecm add <HOST-A-IP>Verify both hosts see each other:
pvecm statusExpected: 2 nodes listed.
Add the QDevice
Section titled “Add the QDevice”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:
apt updateapt install corosync-qnetdsystemctl enable --now corosync-qnetdsystemctl is-active corosync-qnetdss -lnt | grep 5403Expected: active, and a listener on TCP 5403. Both Proxmox hosts must be able to reach that port.
On both Proxmox hosts:
apt install corosync-qdevicepvecm 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:
pvecm qdevice setup <TIEBREAKER-IP>Read the output through Done. A run that stops earlier does not change the vote count. Then:
pvecm statusExpected: 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:
corosync-qnetd-tool -lExpected: homelab-cluster with both Proxmox nodes connected.
If the Tiebreaker Is an Appliance NAS
Section titled “If the Tiebreaker Is an Appliance NAS”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.
Install corosync-qnetd
Section titled “Install corosync-qnetd”On the NAS:
apt updateapt install corosync-qnetdUnable 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:
rm -f /etc/apt/sources.list.d/debian-main.listapt updateUnmet 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:
apt install corosync-qnetd libnss3-tools time libconfig9 libxcb-damage0 libxcb-image0 libxcb-render-util0 libxcb-xinerama0 vim-runtimeDo 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:
systemctl enable --now corosync-qnetddpkg -s corosync-qnetd | grep -E '^(Status|Version):'systemctl is-active corosync-qnetdss -lnt | grep 5403Expected: 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.
Allow Root Key Login
Section titled “Allow Root Key Login”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:
cat /root/.ssh/id_rsa.pubOn 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:
mkdir -p /root/.sshchmod 700 /root/.sshecho 'PASTE_THE_PUBKEY_LINE_HERE' >> /root/.ssh/authorized_keyschmod 600 /root/.ssh/authorized_keysprintf 'PermitRootLogin prohibit-password\n' > /etc/ssh/sshd_config.d/99-proxmox-qdevice.confsystemctl reload ssh || systemctl reload sshdsshd -T | grep permitrootloginExpected: permitrootlogin prohibit-password. Back on the same Proxmox host, this must print ok without a password:
ssh -o BatchMode=yes root@<TIEBREAKER-IP> echo okpvecm 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.
Recreate the Certificate Database
Section titled “Recreate the Certificate Database”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:
corosync-qnetd-certutil -ichown -R coroqnetd:coroqnetd /etc/corosync/qnetd/nssdbsystemctl start corosync-qnetdWhen the database already exists and only qnetd-cacert.crt is missing, export the CA instead of deleting the directory. On the NAS, as root:
chmod 755 /etc/corosync/qnetd /etc/corosync/qnetd/nssdbcertutil -L -d sql:/etc/corosync/qnetd/nssdb -n "QNet CA" -f /etc/corosync/qnetd/nssdb/pwdfile.txt > /etc/corosync/qnetd/nssdb/qnetd-cacert.crtcertutil -L -d sql:/etc/corosync/qnetd/nssdb -n "QNet CA" -a -f /etc/corosync/qnetd/nssdb/pwdfile.txt >> /etc/corosync/qnetd/nssdb/qnetd-cacert.crtchown -R coroqnetd:coroqnetd /etc/corosync/qnetd/nssdbchmod 644 /etc/corosync/qnetd/nssdb/qnetd-cacert.crtsystemctl restart corosync-qnetdls -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:
pvecm qdevice setup <TIEBREAKER-IP> --force 1Copy the CA When scp Cannot See It
Section titled “Copy the CA When scp Cannot See It”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):
rm -f /root/bin/scp /usr/local/bin/scprmdir /root/bin 2>/dev/null || trueReplace /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.realcat > /usr/bin/scp << 'EOF'#!/bin/bashreal=/usr/bin/scp.realfiltered=()skip=0for a in "$@"; do if [ "$skip" = 1 ]; then skip=0; continue; fi case "$a" in -O) ;; -o) skip=1 ;; *) filtered+=("$a") ;; esacdonesrc=${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" "$@"fiEOFchmod 755 /usr/bin/scphead -2 /usr/bin/scphead 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:
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:
mv /usr/bin/scp.real /usr/bin/scpThe 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.
Verify Before Moving On
Section titled “Verify Before Moving On”On either Proxmox host:
pvecm statusExpected: Expected votes: 3, Total votes: 3, Flags: Quorate Qdevice.
Next: Provision the Six VMs.