VM harness: network topology via containerlab bridges (test-02, RouterOS stand-ins) #31

Open
opened 2026-11-14 02:04:23 +00:00 by ginjiruu · 0 comments
Owner

Part of lab/clusters#1668 (internal network). Feeds ADR-0011 (host VIPs) and lab/iac#43 (router as code).

Refs: lab/iac#63 (RouterOS sim, now containerlab), lab/iac#70 (round-trip gate), lab/iac#74 (on-box rollback timer), lab/iac#46 (router HA).

Rewritten 2026-11-13: containerlab provides the network fabric. The raw-QEMU harness stays.

Problem

The VM harness is one VM (test-01) on QEMU user networking. It can't test anything that needs a shared L2 segment or a router:

  • ADR-0011 keepalived VIPs need two VRRP peers and a client that watches the address move.
  • Router changes (VRRP gateway, BGP from Cilium, DHCP/DNS from mc#16) only show their effect on hosts behind the router.

Decision

  • containerlab owns the topology: the RouterOS routers (lab/iac#63: mikrotik_chr, official mikrotik/chr image, RB5009 port names), the WAN/ISP node, and the L2 segments as containerlab bridge nodes (Linux bridges on the harness host).
  • The raw-QEMU harness keeps the hosts. test-01/test-02 still boot the real installer ISO under OVMF, with fw_cfg enrollment, disko, systemd-boot, boot counting and watchdog. containerlab's generic_vm kind can't do that: it's a vrnetlab wrapper for prebuilt cloud images, with no ISO install, UEFI NVRAM control or fw_cfg. So containerlab does not replace the harness. The VMs swap -netdev user for taps on the containerlab bridges (root, or qemu-bridge-helper with /etc/qemu/bridge.conf).
  • Vagrant was rejected for the same install-path reason.
  • One topology file: lab/iac routeros/sim/lab.clab.yml. machine-configs refers to it rather than keeping its own copy.

Stages

  • vm:net-up / vm:net-down: deploy the lab/iac containerlab topology plus a lan bridge, then attach test-01/test-02 taps.
  • vm:vip-check: VIP moves within seconds when the holder's tracked service stops; no holder while OpenBao is sealed (ADR-0011).
  • Router stage: apply the device config to both CHRs, reboot one, and measure what the hosts lose (lab/iac#46).

Done when

  • task vm:net-up / vm:net-down bring the topology up and down with no manual steps
  • test-01 and test-02 share an L2 segment with both RouterOS stand-ins
  • vm:vip-check green on it
  • the existing vm:e2e stages still pass, on user-net or on the bridge
  • docs/vm-testing.md gains a "network topology" section and its "Known harness limits" list loses the single-NIC limit
Part of lab/clusters#1668 (internal network). Feeds ADR-0011 (host VIPs) and lab/iac#43 (router as code). Refs: lab/iac#63 (RouterOS sim, now containerlab), lab/iac#70 (round-trip gate), lab/iac#74 (on-box rollback timer), lab/iac#46 (router HA). **Rewritten 2026-11-13: containerlab provides the network fabric. The raw-QEMU harness stays.** ## Problem The VM harness is one VM (test-01) on QEMU user networking. It can't test anything that needs a shared L2 segment or a router: - ADR-0011 keepalived VIPs need two VRRP peers and a client that watches the address move. - Router changes (VRRP gateway, BGP from Cilium, DHCP/DNS from mc#16) only show their effect on hosts behind the router. ## Decision - **containerlab owns the topology:** the RouterOS routers (lab/iac#63: `mikrotik_chr`, official `mikrotik/chr` image, RB5009 port names), the WAN/ISP node, and the L2 segments as containerlab `bridge` nodes (Linux bridges on the harness host). - **The raw-QEMU harness keeps the hosts.** test-01/test-02 still boot the real installer ISO under OVMF, with fw_cfg enrollment, disko, systemd-boot, boot counting and watchdog. containerlab's `generic_vm` kind can't do that: it's a vrnetlab wrapper for prebuilt cloud images, with no ISO install, UEFI NVRAM control or fw_cfg. So containerlab does **not** replace the harness. The VMs swap `-netdev user` for taps on the containerlab bridges (root, or `qemu-bridge-helper` with `/etc/qemu/bridge.conf`). - Vagrant was rejected for the same install-path reason. - **One topology file:** lab/iac `routeros/sim/lab.clab.yml`. machine-configs refers to it rather than keeping its own copy. ## Stages - `vm:net-up` / `vm:net-down`: deploy the lab/iac containerlab topology plus a `lan` bridge, then attach test-01/test-02 taps. - `vm:vip-check`: VIP moves within seconds when the holder's tracked service stops; no holder while OpenBao is sealed (ADR-0011). - Router stage: apply the device config to both CHRs, reboot one, and measure what the hosts lose (lab/iac#46). ## Done when - [ ] `task vm:net-up` / `vm:net-down` bring the topology up and down with no manual steps - [ ] test-01 and test-02 share an L2 segment with both RouterOS stand-ins - [ ] `vm:vip-check` green on it - [ ] the existing `vm:e2e` stages still pass, on user-net or on the bridge - [ ] `docs/vm-testing.md` gains a "network topology" section and its "Known harness limits" list loses the single-NIC limit
ginjiruu changed title from VM harness: virtual network topology (test-02, L2 segments, RouterOS stand-ins) to VM harness: network topology via containerlab bridges (test-02, RouterOS stand-ins) 2026-11-14 02:56:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/machine-configs#31
No description provided.