Documentation
¶
Overview ¶
Package orchestrator owns the VM lifecycle: it resolves the per-call dependencies (store, SSH key, image, backend), creates the backend network, and boots, waits for, and tears down VMs. It is the only place the internal/backend implementations are wired in, so it is the one package whose import graph carries a hypervisor (vz on darwin, cloud-hypervisor on linux).
On linux the root fleetbox package imports the orchestrator and runs it in-process. On darwin the root package does NOT import it — the orchestrator lives only inside the downloaded, signed fleetbox-helper, and the root package is a thin pure-Go client that drives the helper over a socket (ADR-0017). The clustering-capability gate and the public ErrClustersUnsupported sentinel live in the root package, not here: a caller is expected to have checked SupportsClustering before adding a second member, so Cluster.Add boots unconditionally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NestedVirtSupported ¶
func NestedVirtSupported() bool
NestedVirtSupported reports whether nested virtualization is available on this host, asking the backend directly. On darwin it is the authoritative VZ check (the root client uses a pure-Go heuristic to avoid downloading the helper just to skip a test); on linux it probes /dev/kvm and the KVM nested parameter.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is a set of VMs sharing one network, so every member reaches the others by IP — a vmnet SharedMode network on macOS, a Linux bridge on Linux (ADR-0008, ADR-0011). The shared network is a runtime object tied to the Cluster's lifetime — never persisted, so a Cluster is a runtime handle, not on-disk state. Members can be added after creation, which is what lets a CLI holder process grow a live cluster without recreating its network.
func NewCluster ¶
NewCluster creates a cluster's shared network but boots no VMs. Use Add to bring members up on it. Shared setup (store, SSH key, image, backend) runs once here and is reused for every Add.
func (*Cluster) Add ¶
Add boots an additional VM on the cluster's shared network and registers it as a member. The new VM reaches every existing member by IP. The clustering-capability gate lives in the root package's Cluster.Add, which is expected to have rejected a second member on a non-clustering backend before reaching here, so Add boots unconditionally.
func (*Cluster) Close ¶
Close releases the cluster's shared network. Call it once every member has been stopped or destroyed — on Linux it tears down the bridge and egress rules; on macOS it is a no-op (the vmnet network is released by GC). It is idempotent.
func (*Cluster) SupportsClustering ¶
SupportsClustering reports whether this cluster's backend can interconnect VMs on its shared network. It is false only on macOS older than 26, where VZ NAT isolates VMs from one another (ADR-0008, ADR-0012); the root package's gate consults it before booting a second member.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM represents a running virtual machine owned by the orchestrator.
func Start ¶
Start creates and boots a new VM with the given name on its own one-member network. If the VM already exists, it boots the existing VM.