Migration engine (voltron-agent)

CRIU checkpoint/restore, cross-node deputy/remote, attach-to-restored.

The agent is the mechanism side of Voltron: it turns a decision (migrate cgroup X -> node Y) into an actual move — checkpoint with CRIU, hand the image to the target over the shared OCFS2 mount, restore there, and keep the process's network served by the home-node deputy via seccomp.

1Components

ModuleRoleStatus
netpin.cseccomp user-notif deputy/remote (network pinning)working, self-tested
decision.cconsume /sys/kernel/voltron/decisionsworking
migrate.ccgroup→pids, dump→manifest on shared FS, restore on targetscaffolding (needs CRIU + cluster)
criu.cwrappers around the criu binarycompiled (needs criu to run)
stream.cbridge image bytes over /dev/voltron_rdma (in-kernel RDMA)working (needs the module + a peer)

2Network pinning (the signature piece)

A remote process runs under a seccomp filter that returns SECCOMP_RET_USER_NOTIF for network + identity syscalls (socket, connect, sendto, recvfrom, close, getpid). The deputy holds the notify fd and for each trap:

Try it on any Linux box (no cluster, no kernel module needed):

cd userspace/voltron-agent && make
./voltron-agent --selftest-netpin         # single-process deputy
./voltron-agent --selftest-netpin-split   # deputy in a SEPARATE process
./voltron-agent --run -- sh -c 'echo $$'   # shell sees the deputy-served pid

3Cross-node deputy/remote (home node keeps the sockets)

The deputy and the remote supervisor can live on different nodes, connected by a transport fd (the RDMA channel on the cluster, or any socket). Each trapped net syscall is marshalled (struct np_req/np_resp, with input/output payloads) to the deputy, which runs it on the real socket it owns and returns the result; the remote applies it back to the traced process (placeholder fd via ADDFD, output written with process_vm_writev).

# home node: run the deputy on a connected transport fd
voltron-agent --deputy --transport-fd N
# exec node: run CMD, forwarding its net syscalls to that deputy
voltron-agent --remote --transport-fd N -- CMD args

Self-orchestrating remote exec (no manual fd wiring)

Agents establish the deputy/remote transport themselves over a control connection (RDMA/mTLS on the cluster; TCP here):

# exec node: run the control server
voltron-agent --serve --listen 7854
# home node: run CMD on the exec node with its network pinned back here
voltron-agent --run-remote <exec-ip>:7854 -- CMD args

The connection carries the forwarded syscalls; --run-remote is the deputy, --serve runs CMD under the remote supervisor. CRIU-free and fully working.

Verified: voltron-agent --selftest-remote-exec (two agent roles over loopback) and a real two-process --serve/--run-remote run - the exec-node shell's getpid is served by the home-node deputy.

4Migration flow (source → target)

  1. The agent polls /sys/kernel/voltron/decisions for new decisions. A decision it reads is a migration out of this node (the home node).
  2. Source: resolve the cgroup's pids (cgroup.procs), criu dump the root process tree into <shared>/.voltron/mig/<id>/, and write a manifest (cgroup, target, source, root_pid).
  3. Target: the agent there polls the mig dir, finds manifests addressed to its local_id, and criu restores the image, then pins the restored process by injecting the netpin filter into it and forwarding to the home deputy.

5Attaching netpin to an existing / restored process

va_netpin_attach(pid, transport_fd) installs the filter into a process we did not fork - e.g. one CRIU just restored - without its cooperation:

voltron-agent --attach <pid> [--transport-fd N]   # N = conn to the home deputy

Proven: voltron-agent --selftest-attach injects the filter into a running task and serves its getpid/socket/connect/send/recv from the deputy.

Remaining integration: CRIU --leave-stopped leaves the task group-stopped, which blocks ptrace-driven injection (a group-stopped tracee won't run injected code); attach is proven for running / syscall-blocked tasks. The restore path needs to (a) open the deputy connection back to the source node and (b) bring the restored task to an injectable state (restore running into a freezer, or a CRIU action-script hook) before calling va_netpin_attach.

The image can ride the shared OCFS2 mount, or be streamed over the in-kernel RDMA path (below) for nodes without (or faster than) the shared FS.

6RDMA image streaming (/dev/voltron_rdma)

The kernel module exposes a bulk byte-stream over the RC QP as a misc device:

The agent bridges it:

# target: receive an image tar from RDMA into a dir
mkdir img && (cd img && tar -xf -) < <(voltron-agent --stream-recv)
# source: stream an image dir to node 2
tar -cf - -C img . | voltron-agent --stream-send 2

va_stream_send()/va_stream_recv() are also called by migrate.c as an alternative to the shared-FS handoff. Page-granular RDMA (READ/WRITE of registered memory regions) is a later optimization over this byte-stream.

Because the image can also ride the shared OCFS2 mount, no separate transfer is strictly required - RDMA streaming is the faster path when the fabric is up.

7Run

# node-local agent (reads decisions, performs migrations)
sudo ./voltron-agent --local-id 1 --mig-dir /srv/shared/.voltron/mig --criu /usr/sbin/criu
#   --dry-run    log CRIU/migration actions instead of performing them

8Requirements & current limits