feat!: declare the guest agent per guest OS, and share what provisioning needs #20

Merged
christianmanivong merged 1 commits from feat/guest-os-provisioning into main 2026-10-08 05:57:09 +00:00
Owner

Groundwork for FreeBSD and OpenBSD guests in netOrk's VM provisioning (NetOrk/netork#794).

Change

  • HypervisorDriver.GUEST_AGENTS = {guest_os: (packages, runcmd)} replaces GUEST_AGENT_PACKAGES / GUEST_AGENT_RUNCMD. It stays class-level data, because netOrk reads it off the driver class without connecting. The keys are the guests a driver provisions; create_vm_from_cloud_init(guest_os=...) is documented to refuse any other with ValueError. The base keeps Linux with qemu-guest-agent.
  • New module provisioning:
    • QEMU_GUEST_AGENTS: Linux, FreeBSD (qemu-guest-agent, sysrc + service), OpenBSD (qemu-ga, rcctl), verified on FreeBSD 15.1 and OpenBSD 7.9 cloud images (NetOrk/netork#793).
    • network_config(): network-config v2 with MAC matching, moved here from napalm-vmware. FreeBSD's nuageinit reads only v2; on the v1 Proxmox generates it fails and skips runcmd.
    • split_compression(): suffix → unpack command (xz, gz, bz2, zst).
  • README: a paragraph on GUEST_AGENTS and the module.
  • Version 3.0.0 (breaking: the two attributes are removed). napalm-vmware and netOrk are the only users; both follow in their own PRs.

Merge order

This one first. NAPALM/napalm-proxmox and NAPALM/napalm-vmware build against device-types main in CI, and netOrk pins all three afterwards.

Tests

tests/test_provisioning.py (new); the superseded TestGuestAgentDeclaration in test_vm_identifiers.py is removed. 399 passed.

Groundwork for FreeBSD and OpenBSD guests in netOrk's VM provisioning (NetOrk/netork#794). ## Change - `HypervisorDriver.GUEST_AGENTS = {guest_os: (packages, runcmd)}` replaces `GUEST_AGENT_PACKAGES` / `GUEST_AGENT_RUNCMD`. It stays class-level data, because netOrk reads it off the driver class without connecting. The keys are the guests a driver provisions; `create_vm_from_cloud_init(guest_os=...)` is documented to refuse any other with ValueError. The base keeps Linux with qemu-guest-agent. - New module `provisioning`: - `QEMU_GUEST_AGENTS`: Linux, FreeBSD (`qemu-guest-agent`, `sysrc` + `service`), OpenBSD (`qemu-ga`, `rcctl`), verified on FreeBSD 15.1 and OpenBSD 7.9 cloud images (NetOrk/netork#793). - `network_config()`: network-config v2 with MAC matching, moved here from napalm-vmware. FreeBSD's nuageinit reads only v2; on the v1 Proxmox generates it fails and skips runcmd. - `split_compression()`: suffix → unpack command (`xz`, `gz`, `bz2`, `zst`). - README: a paragraph on `GUEST_AGENTS` and the module. - Version 3.0.0 (breaking: the two attributes are removed). napalm-vmware and netOrk are the only users; both follow in their own PRs. ## Merge order This one first. NAPALM/napalm-proxmox and NAPALM/napalm-vmware build against device-types `main` in CI, and netOrk pins all three afterwards. ## Tests `tests/test_provisioning.py` (new); the superseded `TestGuestAgentDeclaration` in `test_vm_identifiers.py` is removed. 399 passed.
christianmanivong added 1 commit 2026-10-08 05:53:35 +00:00
feat!: declare the guest agent per guest OS, and share what provisioning needs
CI / test (3.10) (push) Successful in 39s
CI / test (3.11) (push) Successful in 36s
CI / test (3.12) (push) Successful in 39s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.11) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 24s
885c7e1f53
GUEST_AGENT_PACKAGES / GUEST_AGENT_RUNCMD described one agent per
hypervisor. A hypervisor that provisions FreeBSD and OpenBSD guests needs
a different agent per guest, and netOrk has to know which guests a driver
can provision at all (NetOrk/netork#794). Both now come from one
class-level mapping netOrk reads off the driver class:

    GUEST_AGENTS = {guest_os: (packages, runcmd)}

Its keys are the guests the driver provisions, and
create_vm_from_cloud_init(guest_os=...) refuses any other. The base keeps
Linux with qemu-guest-agent.

New module `provisioning`, generic for every hypervisor:
- QEMU_GUEST_AGENTS: the QEMU agent for Linux, FreeBSD and OpenBSD, with
  package names and service commands verified on FreeBSD 15.1 and
  OpenBSD 7.9 cloud images (NetOrk/netork#793).
- network_config(): cloud-init's network-config v2 with MAC matching,
  moved here from napalm-vmware. FreeBSD's nuageinit reads no other
  version.
- split_compression(): how a packed image (.xz, .gz, .bz2, .zst) is
  unpacked.

BREAKING CHANGE: GUEST_AGENT_PACKAGES and GUEST_AGENT_RUNCMD are gone;
drivers declare GUEST_AGENTS instead.
christianmanivong merged commit 95d9031c8d into main 2026-10-08 05:57:09 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#20