Skip to content
The witness on Proxmox

The witness on Proxmox

Makes the witness VM on Proxmox VE: the third voter, beside the sites’ module. Two sites and a witness has the whole sequence.

What has been checked: what was checked for the sites’ module, and in the cloud-init an offline plan renders, every variable (witness_id, witness_bind, the peer list, witness_bootstrap, the repository and ref) lands where it should. It has never been applied to a real Proxmox cluster; disk.interface depends on your template.

What the first boot does

cloud-init clones the repository at qfence_repo_ref, and builds the witness on the VM with the Go that go.mod names, downloaded from go.dev. It installs it as step 4 of the install guide does, removes the toolchain, writes the env file and starts the service. The VM needs outbound HTTPS to your git host, go.dev and proxy.golang.org. This first-boot script has been run on Ubuntu 22.04, the template’s OS, in a container.

Raft runs in plaintext, since the env file has no TLS settings, unless all three voters get certificates, as the sites’ module says.

Prerequisite

Needs the same cloud-init-enabled template as the orchestrator sites — see ../../../orchestrator/terraform/proxmox/README.md for how to create one (the same template works for both).

Usage

module "witness" {
  source = "github.com/REPLACE_ME/qfence//deploy/witness/terraform/proxmox"

  proxmox_endpoint  = "https://pve.example.lan:8006/"
  proxmox_api_token = "terraform@pve!qfence=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  proxmox_insecure  = true

  # A node independent of both sites' own placement, per §8 — a
  # separate physical host if your Proxmox setup allows it, or at
  # minimum a separate node in the same cluster.
  target_node    = "pve3"
  template_vm_id = 9000

  witness_ip = "10.0.0.5/24"
  gateway    = "10.0.0.254"

  # From the orchestrator sites module's own site_addresses output:
  sites = [
    "dc1=10.0.0.1:7000",
    "dc2=10.0.0.2:7000",
  ]

  qfence_repo_url   = "https://gitlab.com/REPLACE_ME/qfence.git"
  qfence_repo_ref   = "main" # pin a real tag/commit for anything beyond a first test
  witness_bootstrap = true   # forming the cluster together with both sites
}

Only one Proxmox host available?

If your lab only has a single Proxmox node, set target_node to the same value here as in the orchestrator sites module — it will still work, just without the failure-domain independence §8 actually wants. Treat that as a known limitation of a single-host lab, not something this module should paper over by pretending otherwise.