No description
  • Rust 92.9%
  • Shell 6.7%
  • Makefile 0.4%
Find a file
despiegk 6715145724
Some checks failed
Unit and Integration Test / test (push) Failing after 9s
chore: canonicalize LICENSE
2026-05-27 19:58:47 +02:00
.forgejo/workflows ci: retarget release + tests workflows at post-rewrite binaries 2026-04-17 15:18:21 +02:00
crates chore(workspace): finalize v2 -> canonical rename 2026-04-17 15:02:53 +02:00
docs docs: remove pre-rewrite user-facing documentation 2026-04-17 15:32:11 +02:00
scripts Merge branch 'development' of https://forge.ourworld.tf/geomind_code/chvm into development_rename_chvm_to_my_hypervisor 2026-03-24 11:09:41 +02:00
.gitignore chore(workspace): finalize v2 -> canonical rename 2026-04-17 15:02:53 +02:00
Cargo.lock chore(workspace): finalize v2 -> canonical rename 2026-04-17 15:02:53 +02:00
Cargo.toml chore(workspace): finalize v2 -> canonical rename 2026-04-17 15:02:53 +02:00
LICENSE chore: canonicalize LICENSE 2026-05-27 19:58:47 +02:00
Makefile chore(build): strip CLI-era Makefile targets 2026-04-17 15:20:48 +02:00
README.md docs: restructure README with standard sections 2026-05-27 16:24:14 +02:00

my_hypervisor

What this is

Narrow VM control-plane daemon for MOS. Runs cloud-hypervisor instances on behalf of the slice manager (hero_compute) and exposes lifecycle control over JSON-RPC 2.0 on a Unix socket.

Not a CLI. User-facing commands live in hero_compute and the MOS installer; my_hypervisor is a system daemon.

Scope:

See ADR-006. In one paragraph: cloud-hypervisor lifecycle (spawn / supervise / reap), per-VM 8-state FSM with transition ring buffer, plumbing (serial console UDS, vsock exec proxy, hero_rpc2 adapter). Delegates OCI, storage, and networking preparation to other daemons.

What this repository contains

Binary Role
my_hypervisor-daemon Long-running root daemon; listens on the RPC socket
my_hypervisor-init Guest-side PID 1, statically linked via musl

Crate layout:

crates/
  my_hypervisor-lib/     library: orchestrator, FSM, state store, RPC adapter
  my_hypervisor-daemon/  thin binary wrapping run_server()
  my_hypervisor-init/    guest PID 1 (musl static)

Build:

cargo build --workspace --release

Integration with MOS image assembly lives in mos_builder.

Run (local dev):

sudo ./target/release/my_hypervisor-daemon \
    --rpc-socket   /run/my_hypervisor/rpc.sock \
    --state-dir    /run/my_hypervisor/vms \
    --console-dir  /run/my_hypervisor

Requires: KVM, cloud-hypervisor >= v50, root (for /dev/kvm and tap ioctls). See ADR-006 for the privilege stance.

Socket mode defaults to 0600 root:root; group-grant policy deferred to the hero_rpc2 rethink.

RPC surface:

compute.vm.* namespace over line-delimited JSON-RPC 2.0 at the RPC socket. Supported methods: create, start, stop, remove, status, list, events.tail, console.endpoint, logs, exec. See crates/my_hypervisor-lib/src/rpc/server.rs or call rpc.discover.

Lifecycle state machine:

Pending → Provisioning → Configured → Starting → Running
                                       ↓            ↓
                                  StartFailed   Stopping → Stopped
                                                    ↓
                                                 Failed

Architecture documents:

Role in the stack

my_hypervisor is the low-level VM runtime daemon in the MOS/Hero stack. It owns cloud-hypervisor lifecycle, the VM state machine, serial console plumbing, and vm_exec proxying. It does not own scheduling, slice math, or tenancy — those live in hero_compute.

After the redesign, state authority is split:

  • Cluster-level identity / tenancy — owned by hero_compute (slices, ownership, secrets, quotas). Persisted in OsiS. Survives node failure.
  • Host-level VM runtime state — owned by my_hypervisor (PID, sockets, cloud-hypervisor config, OCI image cache pointers). Local to the host.

hero_compute talks to my_os_server exclusively; my_os_server proxies compute.* to the local my_hypervisor socket, mirroring how net.* proxies to mosnet and vol.* proxies to mos_volmgrd.

hero_proc is out of the VM path. It keeps doing what it is good at for non-VM workloads (declarative services, dependency graph, health checks, cron, PTY attach, secrets, web admin).

Relation to ThreeFold

This technology is used within the ThreeFold ecosystem and was first deployed on the ThreeFold Grid. The component itself is designed as reusable infrastructure technology and should be understood by its technical function first, independent of any specific deployment.

Ownership

This repository is owned and maintained by TF-Tech NV, a Belgian company responsible for the development and maintenance of this technology.

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.