syntheses:compute-host-stack
Differences
This shows you the differences between two versions of the page.
| syntheses:compute-host-stack [16/07/2026 03:54] – created - external edit 127.0.0.1 | syntheses:compute-host-stack [15/10/2026 05:26] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Compute Host Stack ====== | ||
| - | |||
| - | ===== Notes ===== | ||
| - | |||
| - | |||
| - | |||
| - | ===== Summary ===== | ||
| - | |||
| - | ====== Compute Host Stack ====== | ||
| - | |||
| - | ===== Overview ===== | ||
| - | |||
| - | The compute host stack runs on physical servers (Xen/KVM hosts) and manages guest VPS lifecycle. It consists of software from multiple repos: | ||
| - | |||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | |||
| - | ===== Architecture ===== | ||
| - | |||
| - | < | ||
| - | Customer Action | ||
| - | ↓ | ||
| - | WebApi / PanelSite / ClassicPanel | ||
| - | ↓ | ||
| - | Domain validation → NHibernate persistence | ||
| - | ↓ | ||
| - | HostCommand created (Infrastructure/ | ||
| - | ↓ | ||
| - | HostDaemon (on compute host) receives & executes command | ||
| - | ↓ | ||
| - | Guest lifecycle: start/ | ||
| - | ↓ | ||
| - | qemu-network/ | ||
| - | </ | ||
| - | |||
| - | ===== Key Components ===== | ||
| - | |||
| - | ==== HostDaemon (product/ | ||
| - | |||
| - | .NET daemon running on each compute host. Handles guest lifecycle commands: | ||
| - | |||
| - | < | ||
| - | product/ | ||
| - | ├── Applets/ | ||
| - | ├── Application/ | ||
| - | ├── GuestConfiguration/ | ||
| - | ├── Handlers/ | ||
| - | ├── Helpers/ | ||
| - | ├── Hosted/ | ||
| - | ├── LoggingContext/ | ||
| - | ├── Properties/ | ||
| - | ├── Scripts/ | ||
| - | ├── Services/ | ||
| - | ├── config/ | ||
| - | ├── BlockingHostCommandHandler.cs | ||
| - | ├── HostCommandExecutor.cs — Executes commands on hosts | ||
| - | ├── HostCommandHandler.cs | ||
| - | ├── HostShell.cs | ||
| - | ├── SshShell.cs | ||
| - | ├── Program.cs | ||
| - | └── appsettings.json | ||
| - | </ | ||
| - | |||
| - | Key classes: | ||
| - | * **HostCommand** — The command object sent from WebApi to HostDaemon | ||
| - | * **HostCommandExecutor** — Executes commands, manages ordering | ||
| - | * **HostCommandHandler** — Interface for handling specific command types | ||
| - | * **HostShell / SshShell** — Abstraction for executing commands on hosts | ||
| - | |||
| - | ==== qemu-network (vps/ | ||
| - | |||
| - | iptables/ | ||
| - | |||
| - | * **Script:** '' | ||
| - | * Uses claim_lock " | ||
| - | * Serialises across ALL guests on a host (one customer' | ||
| - | * Critical bug surface: unbounded firewall rules cause Cartesian product explosion | ||
| - | |||
| - | ==== infrastructure/ | ||
| - | |||
| - | Scripts and configs deployed to compute hosts: | ||
| - | |||
| - | < | ||
| - | infrastructure/ | ||
| - | ├── etc/ — Host configuration files | ||
| - | ├── hostdaemon/ | ||
| - | ├── ovmf/ — UEFI firmware files | ||
| - | ├── qemu-network/ | ||
| - | ├── routed/ | ||
| - | ├── scripts/ | ||
| - | ├── services/ | ||
| - | ├── smtbalance/ | ||
| - | ├── xm/ — Xen configuration | ||
| - | ├── xmconfig/ | ||
| - | └── xm-for-kvm/ | ||
| - | </ | ||
| - | |||
| - | ==== vps/compute (project 22) ==== | ||
| - | |||
| - | Separate repo for compute host programs: | ||
| - | |||
| - | < | ||
| - | vps/ | ||
| - | ├── hostdaemon/ | ||
| - | ├── ovmf/ — UEFI firmware | ||
| - | ├── power-limiter/ | ||
| - | ├── qemu-network/ | ||
| - | ├── routed/ | ||
| - | ├── scripts/ | ||
| - | ├── services/ | ||
| - | ├── smtbalance/ | ||
| - | ├── xm/ — Xen | ||
| - | ├── xmconfig/ | ||
| - | └── xm-for-kvm/ | ||
| - | </ | ||
| - | |||
| - | ===== Guest Lifecycle Commands ===== | ||
| - | |||
| - | Commands flow from WebApi → HostCommand → HostDaemon: | ||
| - | |||
| - | - **Power operations** — start, stop, restart, reinstall | ||
| - | - **Network** — firewall rules, interface changes, VPC assignment | ||
| - | - **Migration** — live migration between hosts | ||
| - | - **Backup** — backup/ | ||
| - | - **Configuration** — DNS, reverse DNS, hostname changes | ||
| - | - **Maintenance** — scheduled maintenance windows | ||
| - | |||
| - | ===== Firewall Rule Flow (Critical Path) ===== | ||
| - | |||
| - | This is the most complex and bug-prone path: | ||
| - | |||
| - | - Customer submits firewall rules via WebApi/ | ||
| - | - **Domain validation** → '' | ||
| - | - **NHibernate** persists '' | ||
| - | - **GuestManagementService.UpdateGuestNetwork()** → sends HostCommand to HostDaemon | ||
| - | - **HostDaemon** iterates all firewall rules | ||
| - | - **OperatingSystem.XenConfiguration()** → builds FIREWALLRULES xenConfig string | ||
| - | - **Guest.GetIptablesEntries()** → aggregates across ALL rules | ||
| - | - **GuestFirewallRule.GetIptablesEntries()** → 4-level Cartesian loop (source × dest × protocol × port) | ||
| - | - **qemu-network/ | ||
| - | |||
| - | ===== Xen vs KVM ===== | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * Migration from Xen to KVM is in progress | ||
| - | |||
| - | ===== Infrastructure/ | ||
| - | |||
| - | * **build.sh** — QEMU build script | ||
| - | * **debian-12.cfg** — Debian 12 QEMU configuration | ||
| - | * **harness.sh** — QEMU test harness | ||
| - | * **README.md** — Documentation | ||
| - | |||
| - | ===== Key Bug Surfaces ===== | ||
| - | |||
| - | ==== claim_lock (qemu-network) ==== | ||
| - | * '' | ||
| - | * One customer' | ||
| - | * Known issue #1640 | ||
| - | |||
| - | ==== Unbounded firewall rules ==== | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ==== HostCommand serialization ==== | ||
| - | * HostDaemon processes commands sequentially per guest | ||
| - | * Slow commands (massive firewall apply) block subsequent commands | ||
| - | |||
| - | ===== Related ===== | ||
| - | |||
| - | ==== Related Pages ==== | ||
| - | |||
| - | * [[vps-monorepo-structure|VPS Monorepo - Structure Overview]] | ||
| - | * [[binarylane-architecture-panels-customer-entry-points|BinaryLane Architecture - Panels & Customer Entry Points]] | ||
| - | * [[customer-side-bug-finding-methodology|Customer-Side Bug Finding Methodology]] | ||
| - | * [[dotnet-solution-structure|.NET Solution - product/ | ||
syntheses/compute-host-stack.1784174059.txt.gz · Last modified: by 127.0.0.1
