Skip to main content

Zyvor Fabric Architecture

Overview​

Zyvor Fabric is a virtual machine management platform built in Rust. It provides VM lifecycle management through a REST and WebSocket API, a React web UI, a CLI, a Kubernetes operator, and a Terraform provider, backed by FluxVM, a disposable-VM engine with no systemd dependency (driver.fluxvm_url in zyvor-fabricd.toml). systemd itself is optional for the daemon's own packaging/init too -- it runs fine under systemd or any other supervisor.

System Diagram​

+----------+ +----------+ +-----------+ +------------+
| fabricctl | | Web UI | | K8s | | Terraform |
| (CLI) | | (React) | | Operator | | Provider |
+----+-----+ +----+-----+ +-----+-----+ +------+-----+
| | | |
+--------------+---------------+-----------------+
|
+--------------v--------------+
| zyvor-fabricd daemon |
| (Axum + Tokio async runtime)|
+-+--+--+--+--+--+--+--+--+---+
| | | | | | | | |
+-------------+ | | | | | | | +-------------+
v v | | | | | v v
+---------+ +------+ | | | | | +------+ +-----------+
|cloud-init| | VNC | | | | | | | TPM | | WebSocket |
|Generator | |Proxy | | | | | | |Mgr | | Console |
+---------+ +------+ | | | | | +------+ +-----------+
| | | | |
+--------------+ | | | +-----------+
v v | v v
+---------+ +------+ | +------+ +---------+
|Prometheus| |State | | | HA | | Backup |
|Exporter | |Store | | |Cluster| | Restore |
+---------+ +------+ | +------+ +---------+
v
+-----------------------+
| VM Driver: FluxVM |
+-----------------------+

Crate Structure​

The backend is a Cargo workspace with 53 crates organized into functional areas.

Core​

CratePurpose
zyvor-fabricdMain daemon -- HTTP/WebSocket server, route registration, config loading
zyvor-fabric-vm-driverBuilds VM images via mkosi -- unrelated to VM lifecycle, which is entirely FluxVM's job
vm-modelCore data structures: VM definitions, state enums, request/response types
state-storePersistent VM state with JSON storage, in-memory caching, file persistence
fabricctlCLI -- scriptable command-line tool with JSON/YAML/table output
encryptionEncryption at rest
certificate-managerTLS certificate management

Cloud and Console​

CratePurpose
cloud-initNoCloud ISO generation for automated VM initialization
vnc-proxyWebSocket-to-TCP VNC proxy for noVNC
gpu-passthroughVFIO GPU passthrough (NVIDIA, AMD — generic PCI, no vGPU/Intel GVT-g)

High Availability​

CratePurpose
haetcd-based clustering and leader election
migrationLive and offline VM migration
fault-toleranceAutomatic failover and fencing
replicationData replication across nodes
site-recoveryDisaster recovery plans and execution
predictive-drsDistributed Resource Scheduling

Operations​

CratePurpose
backupBackup/restore with retention policies
schedulerVM scheduling (once, daily, weekly)
lifecycle-managerVM lifecycle automation
resource-poolsResource pool management
datacenterDatacenter and cluster abstractions
content-libraryShared image and template repository
prometheus-exporterPrometheus metrics endpoint
host-agentHost-level agent for cluster management

Technology Stack​

LayerTechnology
LanguageRust (2021 edition)
Async runtimeTokio 1.44
Web frameworkAxum 0.8
Serializationserde + serde_json
CLIclap 4.5
WebReact 19 + Vite
D-Buszbus 4
FrontendReact 19 + TypeScript + Vite + TailwindCSS
Terminal emulatorxterm.js
VNC clientnoVNC
MonitoringPrometheus

API Surface​

  • 780+ REST endpoints covering VM management, snapshots, storage, networking, auth, quotas, schedules, audit, analytics, backups, notifications, templates, tags, cloning, DRS, fault tolerance, replication, site recovery, content library, lifecycle, certificates, encryption, resource pools, distributed storage, datacenters, events, autoscaling, hotplug, and image building.
  • 3 WebSocket endpoints for console access, VNC proxying, and live event streaming.
  • OpenStack compatibility prefixes on the same listen port: /identity, /compute, /image, /network, /volume (experimental façade — see openstack-compat.md).
  • SCIM 2.0 at /scim/v2 for enterprise provisioning (see scim-identity.md).

All native Fabric endpoints use JSON payloads and follow RESTful conventions.

Data Flow​

User --> CLI / Web UI / K8s Operator / Terraform / openstack CLI
|
v
REST /api · /scim/v2 · OpenStack /identity|/compute|…
|
v
Core Daemon (zyvor-fabricd)
/ \
v v
VM Driver State Store (/var/lib/zyvor-fabricd/)
|
v
FluxVM --> Virtual Machines

Storage Layout​

VM state and artifacts are stored under /var/lib/zyvor-fabricd/:

/var/lib/zyvor-fabricd/
*.json VM metadata and configuration
images/ VM disk images
tpm/ Per-VM vTPM state directories
snapshots/ VM snapshot data
backups/ Backup archives
state/ Persistent daemon state

systemd Integration (optional)​

systemd is no longer required to install or run zyvor-fabricd -- packaging has no hard Requires: systemd, no sysusers.d/tmpfiles.d/preset (the daemon creates its own runtime directories at startup), and the backup/cleanup jobs that used to be systemd timers now run from an in-process tokio scheduler. The units below are still shipped for operators who choose to run under systemd anyway; nothing in packaging auto-enables or auto-starts them.

UnitPurpose
zyvor-fabricd.serviceMain daemon (Type=simple; systemd hardening via ProtectSystem=strict, capability bounding -- no socket activation, no watchdog)

VMs themselves are never systemd units -- their lifecycle is owned by FluxVM, which supervises each VM's QEMU / Cloud Hypervisor / Firecracker / FluxVM hypervisor process directly (see the FluxVM driver guide). There is no per-VM systemd unit template.

Security Model​

  • Runs as root (required for VM management and networking)
  • When run under systemd, its hardening directives further restrict filesystem and network access -- not required when run another way
  • JWT-based API authentication with SQLite user store
  • Auto-generated JWT secret persisted to /var/lib/zyvor-fabricd/.jwt_secret (mode 0600)
  • Auto-generated admin password written to /var/lib/zyvor-fabricd/.admin_password (mode 0600) on first startup
  • RBAC with three roles: Admin, User, Viewer
  • TLS support for production deployments
  • vTPM for guest attestation and secure boot
  • Audit logging for all administrative actions
  • Input validation on all user-facing parameters (VM names, IP addresses, paths, storage names)
  • Parameterized SQL queries throughout (no injection risk)
  • No shell pipelines — all subprocess calls use direct argument passing