Zero-Cloud-Tax CI/CD Factory: Proxmox VE Ephemeral Runners & ZFS Warm Snapshot Rollbacks
100% elimination of hosted CI minute bottlenecks, sub-8s ephemeral VM rollback via ZFS snapshots, strict L3 VE firewall isolation, and 2x parallel verification throughput.
“When five autonomous builder slots ship pull requests in parallel, hosted cloud CI stops being a convenience and becomes a metering bottleneck that stalls your merge gate. We moved CI execution onto our sovereign Proxmox VE 9 hypervisor, using ZFS warm snapshot rollbacks and hypervisor-level firewall micro-segmentation to achieve sub-8-second clean-slate runners at $0 marginal minute cost.”
1. The Problem
As our autonomous multi-agent engineering fleet scaled to 5 concurrent builder worktree slots per repository, every completed build had to pass a rigorous verification gate (bin/verify, Vitest unit suites, Docker Playwright E2E browsers, Android/Kotlin gradle builds, and security scans) before hostctl land would merge the pull request. Relying on hosted GitHub Actions runners created three severe operational bottlenecks:
- Hosted CI Billing Ceilings & Queue Starvation: High-frequency parallel waves across multiple repositories rapidly consumed monthly hosted runner minute quotas. When hosted minutes hit a billing cap or concurrency limit, ready-to-merge PRs stalled in
queuedstate—blocking autonomous slot rotation. - Cold-Start Dependency Download Tax: Standard cloud ephemeral runners boot from bare OS images and spend 90 to 180 seconds re-downloading multi-gigabyte container layers, Playwright Chromium binaries, Node toolchains, and Android SDK caches on every single run.
- Security Hazard of Persistent Self-Hosted Runners: The common workaround—running a persistent, stateful self-hosted runner service on a local Linux server—is a notorious security anti-pattern: build artifacts leak across jobs, stray background processes pollute subsequent tests, and a compromised dependency in a PR has direct L2/L3 adjacency to the internal datacenter LAN.
We needed a Zero-Cloud-Tax Sovereign CI/CD Factory—combining the clean-slate cryptographic isolation of ephemeral VMs with the instant cache locality of bare-metal NVMe, engineered on Proxmox VE 9 and ZFS Copy-on-Write (CoW) snapshots.
2. The Constraints
- True Ephemeral Clean-Slate Execution (
--ephemeral): Every CI job had to execute inside a freshly rolled-back virtual machine state (VM 121andVM 122) that is destroyed and restored to a cryptographic golden snapshot immediately upon job exit. - Sub-10-Second Rollback with Pre-Warmed Toolchain Caches: The golden ZFS snapshot (
@warm-golden) had to contain pre-pulled Docker images, Playwright browsers,mise/Node/Python runtimes, and Gradle caches so jobs start executing tests within seconds of dispatch. - Hypervisor-Enforced Zero-Trust Micro-Segmentation: Even if malicious code executed inside a CI job, the runner VMs had to be blocked at the Proxmox VE Firewall layer (outside the guest OS kernel) from initiating connections to RFC1918 management VLANs, Proxmox APIs (
.21:8006), Talos Kubernetes nodes (.15–.19), or the RP1 Edge Vault (.11). - Automated Host Poller Lifecycle: A host-side daemon had to orchestrate JIT runner token registration, job completion detection, ZFS snapshot rollback (
qm rollback), and immediate re-registration across parallel runner VMs without human intervention.
3. Architecture & Key Decisions
We architected a dual-runner ephemeral CI factory on Proxmox VE 9 (.21) backed by an NVMe ZFS storage pool and hypervisor-level nftables/ebtables firewalling:
flowchart TB
subgraph GitHub["Tier 1: PR Gate & Autonomous Land Pipeline"]
PR["Pull Request Verification Gate<br/>(hostctl land · bin/verify · Playwright E2E · Brand Gate)"]
end
subgraph Hypervisor["Tier 2: Proxmox VE 9 Hypervisor (.21) & ZFS NVMe Pool"]
Poller["Ephemeral Runner Lifecycle Poller<br/>(JIT Token Registration · Job Watch · Instant Rollback)"]
ZFS["ZFS NVMe Pool (rpool/data)<br/>Golden Snapshot: @warm-golden (Zero-Copy CoW Rollback)"]
VM121["Ephemeral CI Runner VM 121 (.26)<br/>--ephemeral Runner · Pre-Warmed Docker/Playwright/SDK"]
VM122["Ephemeral CI Runner VM 122 (.27)<br/>--ephemeral Runner · Parallel Wave Verification"]
Poller -->|"qm rollback <vmid> warm-golden"| ZFS
ZFS -->|"Sub-8s CoW Restore"| VM121 & VM122
end
subgraph Firewall["Tier 3: Proxmox VE Hypervisor Firewall (Host-Enforced L3/L4 Gate)"]
VEFW["PVE Host Firewall Ruleset<br/>ALLOW: Outbound TCP 443 (GitHub/Registries)<br/>DROP: RFC1918 Datacenter VLANs (.11, .15-.19, .21)"]
VM121 & VM122 --> VEFW
end
PR <-->|"HTTPS Long-Poll (TCP 443 Outbound Only)"| VEFW
Decision 1: ZFS Copy-on-Write (@warm-golden) Rollbacks Over Cloud Cold Boots
In a traditional cloud CI runner, restoring a clean environment means provisioning a new VM disk and downloading gigabytes of toolchains over the network. On Proxmox VE 9 backed by ZFS, a snapshot rollback (qm rollback 121 warm-golden) simply discards the dirty Copy-on-Write block pointers allocated during the CI run and rewinds the ZFS volume metadata pointer back to @warm-golden.
We run a weekly automated cache-warming job that updates the base image with current container layers and toolchains, takes a fresh @warm-golden snapshot, and freezes it—giving every single CI run a 100% pristine kernel and filesystem with zero cold-start download delay.
Decision 2: Host-Driven Ephemeral Lifecycle Poller
Because a guest VM should never hold long-lived GitHub PATs or Proxmox hypervisor credentials, the runner inside VM 121 and VM 122 is configured with the single-use --ephemeral flag. The moment a single job finishes, the runner binary exits and the guest powers down. A deterministic host-side lifecycle loop detects the VM stop state, rolls back the ZFS disk, boots the VM, and injects a single-use JIT registration config:
#!/usr/bin/env bash
# Proxmox VE Host-Side Ephemeral CI Runner Lifecycle Reconciler
set -euo pipefail
VM_IDS=(121 122)
SNAPSHOT_NAME="warm-golden"
reconcile_ephemeral_runner() {
local vmid="$1"
local status
status="$(qm status "$vmid" | awk '{print $2}')"
# When the single-job --ephemeral runner finishes, the guest shuts down cleanly
if [[ "$status" == "stopped" ]]; then
logger -t pve-ci-factory "Rewinding VM ${vmid} to ZFS snapshot @${SNAPSHOT_NAME}"
qm rollback "$vmid" "$SNAPSHOT_NAME"
qm start "$vmid"
logger -t pve-ci-factory "VM ${vmid} restored and booted in clean-slate state"
fi
}
for vmid in "${VM_IDS[@]}"; do
reconcile_ephemeral_runner "$vmid"
done
Decision 3: Hypervisor-Level Firewall Micro-Segmentation (Outside the Guest Kernel)
A guest-level firewall (ufw or iptables inside the CI VM) is useless if a test job runs with sudo or root Docker privileges inside the VM. We enforced isolation at the Proxmox VE Hypervisor Firewall layer on the host bridge (vmbr0 tap interfaces for VM 121 and VM 122). The ruleset explicitly DROPs all ingress traffic and blocks all egress to RFC1918 private subnets (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) except pinned DNS, while permitting outbound TCP 443 to public artifact endpoints. To the internal sovereign fleet, the CI runners exist in a one-way DMZ cage.
4. Failure Modes & What Went Wrong
Incident 1: Stale Ephemeral Runner Ghost Registrations After Forced Job Cancellation
- What Happened: When an operator canceled a superseded PR workflow mid-run on GitHub, the runner process inside
VM 121receivedSIGINT, exited, and triggered a ZFS snapshot rollback. However, because@warm-goldenhad been captured after static runner registration in our initial prototype, the rolled-back VM booted with an already-consumed runner ID—causing GitHub’s control plane to reject the session as a duplicate offline registration. - Root Cause: Capturing identity state inside the golden ZFS snapshot violated the immutability boundary between base image state and per-boot ephemeral identity.
- Architectural Fix: We stripped all runner registration files (
.runner,.credentials) from@warm-goldenand switched to per-boot Just-In-Time (JIT) runner configuration injected via cloud-init / guest-agent on every rollback boot. Every rollback now registers a fresh, single-use ephemeral identity that self-destructs on completion.
Incident 2: ZFS ARC Memory Contention During Concurrent Docker Playwright Builds
- What Happened: When both
VM 121andVM 122simultaneously launched 4-worker Docker Playwright Chromium E2E suites while the Proxmox ZFS Adaptive Replacement Cache (ARC) was unconstrained, host RAM pressure triggered Linuxkswapd0activity, adding 4.2 seconds of jitter to browser frame rendering tests. - Root Cause: ZFS defaults to consuming up to 50% of host physical RAM for
ARC, competing directly with KVM guest memory allocations during peak dual-VM builds. - Architectural Fix: We pinned
zfs_arc_maxin/etc/modprobe.d/zfs.confto a deterministic ceiling sized below the KVM guest reservation envelope and enabledlz4compression onrpool/data—eliminating host swap activity and locking E2E suite execution variance under 3%.
5. Measurable Outcomes
| Metric | Hosted Cloud CI / Stateful Runner (Before) | Proxmox VE + ZFS Ephemeral Factory (After) | Impact |
|---|---|---|---|
| Hosted CI Billing & Quota Blocks | Recurring minute exhaustion on wave builds | 0 hosted minutes consumed (100% sovereign) | 100% elimination of cloud CI tax & queue blocks |
| Clean-Slate Environment Reset | 95s–180s (cloud VM boot + cache pull) | <8 seconds (qm rollback ZFS CoW snapshot) |
15x–22x faster clean environment readiness |
| Cross-Job State Contamination | High risk on persistent self-hosted runner | 0 contamination (block-level ZFS rewind) | Cryptographically clean disk on every single PR |
| Internal LAN Lateral Exposure | Full L2/L3 subnet visibility | 0 internal reachability (PVE host firewall) | Hard DMZ isolation outside guest kernel |
| Concurrent PR Verification | Single bottlenecked queue | 2 parallel ephemeral VMs (VM 121 & VM 122) |
2x merge-gate throughput for 5-slot waves |
6. First-Principles Takeaway
Copy-on-Write storage turns bare-metal hypervisors into instant-rollback immutable compute.
Engineers often assume they must choose between the slow, metered isolation of cloud-hosted CI runners and the fast, stateful insecurity of a local build box. By pairing ZFS Copy-on-Write snapshots with Proxmox VE hypervisor firewalling and JIT ephemeral runner registration, you get the best of both worlds: local NVMe speed with sub-8-second block-level immutability and zero cloud tax.
Architecture and decisions: mine. Debugging sessions at odd hours: mine. AI assistance: structure, syntax, first draft. — Sachin
⚡ Challenge This Architecture Blueprint with Virtual Sachin (AI Digital Twin)
Stress-test the architectural decisions, failure modes, and operational trade-offs behind Zero-Cloud-Tax CI/CD Factory: Proxmox VE Ephemeral Runners & ZFS Warm Snapshot Rollbacks directly against the edge-native RAG Digital Twin: