Clustering & High Availability
PiVirt clusters unite multiple physical hypervisor nodes into a cohesive, highly available virtualization platform with distributed state, shared storage pools, and live VM migration.
Cluster Architecture
Section titled “Cluster Architecture”flowchart TB
subgraph AZ["Availability Zone"]
subgraph N1["Node 1"]
P1[pivirtd]
A1[agent]
end
subgraph N2["Node 2"]
P2[pivirtd]
A2[agent]
end
subgraph N3["Node 3"]
P3["pivirtd / agent"]
end
end
STORAGE[("Shared Storage<br/>(iSCSI / NFS)")]
AZ --> STORAGE
Cluster Components
Section titled “Cluster Components”Control Plane
Section titled “Control Plane”- director / etcd: Cluster orchestration and state store
- PiTrust CA: PKI identity management, automated X.509 certificate issuance
- agent: Service mesh, API gateway
Data Plane
Section titled “Data Plane”- pivirtd: Hypervisor daemon (per node)
- iscsiman: Storage manager (per node)
- Shared storage: iSCSI, NFS, OCFS2
Cluster Topology
Section titled “Cluster Topology”Single Node
Section titled “Single Node”cluster: name: "dev-cluster" nodes: - name: "node-01" role: "control-plane" ip: "10.0.1.10"Multi-Node
Section titled “Multi-Node”cluster: name: "prod-cluster" control_plane: - name: "cp-01" ip: "10.0.1.10" - name: "cp-02" ip: "10.0.1.11" - name: "cp-03" ip: "10.0.1.12" workers: - name: "worker-01" ip: "10.0.1.20" - name: "worker-02" ip: "10.0.1.21"High Availability
Section titled “High Availability”Control Plane HA
Section titled “Control Plane HA”- 3 or 5 etcd nodes for quorum
- PiTrust CA HA & Operator replication
- Load balancer for director / agent endpoints
Storage HA
Section titled “Storage HA”- iSCSI multipath
- OCFS2 cluster filesystem
- SBD fencing for split-brain prevention
- Automatic restart on failure
- Live migration for maintenance
- Anti-affinity rules
Cluster Operations
Section titled “Cluster Operations”Bootstrap
Section titled “Bootstrap”# Initialize first nodepvcli cluster init --name prod-cluster
# Join additional nodespvcli cluster join --token <join-token> --node-ip 10.0.1.11# Add worker nodespvcli cluster node add --role worker --count 3
# Remove nodepvcli cluster node remove worker-03Maintenance
Section titled “Maintenance”# Drain node for maintenancepvcli cluster node drain worker-01
# Cordon node (no new VMs)pvcli cluster node cordon worker-01
# Uncordonpvcli cluster node uncordon worker-01Quorum & Fencing
Section titled “Quorum & Fencing”Quorum
Section titled “Quorum”- Majority of nodes must be available
- Prevents split-brain scenarios
- Configurable quorum policies
Fencing
Section titled “Fencing”cluster: fencing: enabled: true agent: "ipmi" devices: - name: "node-01-fence" ip: "10.0.0.11" user: "admin" password_ref: "vault:secret/data/bmc/node-01#password"