Skip to content

Multi-host clusters

One controller runs labs on up to three compute hosts, counting itself. A standalone installation needs no cluster setup and behaves as before.

Adding a host

  1. Upgrade the controller and run alembic upgrade head.
  2. As an administrator, create an enrollment command: in System → Cluster choose Add host, optionally name the host, and copy the command (or call POST /api/cluster/enrollment). It is valid once and for 15 minutes.
  3. On the new host, from a checkout of the same release, run that command. It installs the compute agent and joins the controller.
  4. Check readiness in the host list (System → Cluster). Retry checks (POST /api/cluster/hosts/{id}/check) repeats the checks.

Requirements:

  • The controller reaches TCP 7443 (agent API) and 7444 (console tunnel) on every agent. Both require the controller's client certificate.
  • Hosts reach each other on UDP 4789. VXLAN is not encrypted, so the network between hosts must be trusted or encrypted.
  • OpenSSL is installed on the controller and on agents.
  • Dynamips and uBridge are not installed by the agent installer. A host without them reports the runtime as unavailable.
  • IOL licence files are installed per host and are never copied.

Upgrading an agent

Upgrade the controller first, then one agent at a time. An enrolled agent needs no new enrollment command: it keeps its host ID, certificate, key, instance ID and agent.env, so the controller does not gain a second host.

On the agent host, make a checkout as root of the same commit the controller runs. The installer runs with root privileges, so do not use a checkout that a service account or another unprivileged user can change.

sudo git clone https://github.com/fahadysf/nova-ve.git /root/nova-ve-release
cd /root/nova-ve-release
sudo git checkout --detach COMMIT   # the controller's commit
sudo ./deploy/scripts/install-agent.sh --upgrade --dry-run
sudo ./deploy/scripts/install-agent.sh --upgrade

Find COMMIT with git rev-parse HEAD in the controller's application checkout. The installer cannot compare it with the controller, and matching version strings in the host list do not prove that the commits match.

  • --upgrade accepts only --dry-run. It refuses a controller, and a host whose agent service, settings, instance ID or credentials are missing. The dry run makes the same checks, lists missing system packages and changes nothing.
  • The upgrade replaces the agent code, Python dependencies, privileged helpers, sudoers fragment and service unit, then restarts nova-ve-agent. Keep local unit changes in a systemd drop-in.
  • Running nodes stay up across the restart. The host can show as unreachable and its consoles disconnect until the agent is back.
  • Only missing system packages are installed, and installed packages such as Docker and QEMU are left at their versions. If the dry run lists missing packages, apt can still update their dependencies, so review them first: restarting Docker stops its containers.
  • If the upgrade fails, check journalctl -u nova-ve-agent, fix the cause and run it again. The agent can be left partly updated until a run succeeds.

Afterwards, check that the host list shows the same host ID as ready.

Placement

A node's placement_host_id is absent (controller host), null (automatic) or a host id (pinned). The server records assigned_host_id. A node with a disk or saved state stays on the host that holds it until it is wiped.

A paired template that sets "same_host": true keeps its nodes together: each follows the host its partners are on or pinned to, and a conflicting placement is refused.

Reservations count against each host's capacity and the lab owner's quota. If a host stops answering, its nodes become unknown: nothing is released and no second copy is started. Retrying a start resumes the same operation.

Base images, Docker images and user templates are copied to a host on first use, with progress reported on the lab event feed. A different file with the same image name on the target is reported as a conflict and left alone.

Maintenance

Drain a host (Drain in System → Cluster, or POST /api/cluster/hosts/{id}/drain) to stop new placements; the response lists running nodes, stored node disks and dependent networks. A host can be removed once all three are empty.

Removal is never forced. A node becomes unknown, and stays reserved, when its host is unreachable or no longer knows it (for example after the agent's data directory was reset). Nothing then proves the runtime stopped, so the node cannot be started elsewhere or deleted. Bring the host back with its data to resolve it. If that is impossible, keep the host drained: this release has no way to retire it. Resume (POST /api/cluster/hosts/{id}/resume) makes a drained host eligible again, and Remove host removes one with no dependencies.

Removing a host does not contact it. Disable the nova-ve-agent service on a removed machine.

A network whose owner lab file is missing, unreadable or duplicated is left in place and reported as unknown until the file is repaired.

Settings

Variable Default Purpose
CLUSTER_CONTROLLER_URL request URL Controller address written into enrollment commands
CLUSTER_ADVERTISE_ADDRESS route source Controller's underlay IPv4 address
CLUSTER_ENROLLMENT_TTL_SECONDS 900 Enrollment command lifetime
CLUSTER_POLL_SECONDS 5 Health and reconciliation interval
CLUSTER_STALE_SECONDS 20 Age at which a host sample no longer counts
CLUSTER_CPU_OVERCOMMIT 4.0 vCPUs reservable per host CPU
CLUSTER_RAM_RESERVE_MB 1024 RAM kept back on each host
CLUSTER_MIN_FREE_DISK_MB 2048 Free runtime storage required for placement
CLUSTER_NETWORK_MTU 1500 Requested guest MTU, lowered to fit the underlay

Set CLUSTER_CONTROLLER_URL when the browser address is not reachable from new hosts. The controller's certificate authority lives in BASE_DATA_DIR/cluster/; include it in backups. It is not recreated once hosts are enrolled, and certificates are not renewed automatically.

Current limits

  • A managed network's service host (DHCP, NAT) is chosen when the network is created, defaults to the controller host, and cannot be changed afterwards.
  • On cross-host networks, only virtio-net QEMU NICs and Docker interfaces receive the reduced guest MTU. A QEMU NIC that is not linked when its node starts, and every other NIC model or runtime, must be set inside the guest.
  • Bridge-Cloud and other physically bound networks serve controller-host nodes only.
  • Co-located nodes are placed one at a time; capacity for the whole group is not reserved up front.
  • Docker image transfers are not counted against free disk before they start.
  • The placement preview does not consider a node's networks or partners.