feat(vm-provision): provision FreeBSD and OpenBSD guests #16

Merged
christianmanivong merged 1 commits from feat/guest-os into master 2026-10-08 06:05:05 +00:00
Owner

FreeBSD and OpenBSD guests for netOrk's VM provisioning (NetOrk/netork#794), with what the spike on FreeBSD 15.1 and OpenBSD 7.9 cloud images found (NetOrk/netork#793). Needs napalm-device-types 3.0 (NAPALM/napalm-device-types#20, merged).

Change

  • GUEST_AGENTS = QEMU_GUEST_AGENTS (Linux, FreeBSD, OpenBSD); create_vm_from_cloud_init(guest_os=...) refuses an unknown guest before anything is created.
  • VM shell per guest: OS type other for the BSDs; OpenBSD gets agent: 1,type=isa and serial0: socket. Its qemu-ga cannot use virtio-serial, and with the agent as the only ISA serial it lands on com0, where the image keeps its console.
  • BSD guests get a network-config v2 snippet of their own (cicustom: user=…,network=…, MAC read back from net0). FreeBSD's nuageinit fails on Proxmox's v1 and then skips runcmd, which starts the agent. Linux keeps Proxmox's own network-config.
  • Packed images (.qcow2.xz): unpacked on the node after the packed file's checksum is verified; only the unpacked file is cached. download-url unpacks ISOs only, so these always take the SSH path.

Fixed on the way

  • get_vm_status recognises loopback by address. It skipped only an interface called lo; OpenBSD's agent lists lo0 first, so 127.0.0.1 would have become the VM's IP.
  • destroy_vm reads the snippets before deleting the VM and removes all of them. Item 1 of #15; item 2 (the delete task is not awaited) stays open there.

Not verified

The spike ran under qemu/KVM with VMs shaped like Proxmox's, not on a Proxmox node. Still to confirm there: that Proxmox puts serial0 before the ISA agent, so OpenBSD's agent ends up on cua01.

Tests

tests/test_vm_guest_os.py (new, 17 tests); 308 passed.

FreeBSD and OpenBSD guests for netOrk's VM provisioning (NetOrk/netork#794), with what the spike on FreeBSD 15.1 and OpenBSD 7.9 cloud images found (NetOrk/netork#793). Needs napalm-device-types 3.0 (NAPALM/napalm-device-types#20, merged). ## Change - `GUEST_AGENTS = QEMU_GUEST_AGENTS` (Linux, FreeBSD, OpenBSD); `create_vm_from_cloud_init(guest_os=...)` refuses an unknown guest before anything is created. - VM shell per guest: OS type `other` for the BSDs; OpenBSD gets `agent: 1,type=isa` and `serial0: socket`. Its qemu-ga cannot use virtio-serial, and with the agent as the only ISA serial it lands on com0, where the image keeps its console. - BSD guests get a network-config v2 snippet of their own (`cicustom: user=…,network=…`, MAC read back from `net0`). FreeBSD's nuageinit fails on Proxmox's v1 and then skips runcmd, which starts the agent. Linux keeps Proxmox's own network-config. - Packed images (`.qcow2.xz`): unpacked on the node after the packed file's checksum is verified; only the unpacked file is cached. `download-url` unpacks ISOs only, so these always take the SSH path. ## Fixed on the way - `get_vm_status` recognises loopback by address. It skipped only an interface called `lo`; OpenBSD's agent lists `lo0` first, so 127.0.0.1 would have become the VM's IP. - `destroy_vm` reads the snippets before deleting the VM and removes all of them. Item 1 of #15; item 2 (the delete task is not awaited) stays open there. ## Not verified The spike ran under qemu/KVM with VMs shaped like Proxmox's, not on a Proxmox node. Still to confirm there: that Proxmox puts `serial0` before the ISA agent, so OpenBSD's agent ends up on `cua01`. ## Tests `tests/test_vm_guest_os.py` (new, 17 tests); 308 passed.
christianmanivong added 1 commit 2026-10-08 05:58:16 +00:00
feat(vm-provision): provision FreeBSD and OpenBSD guests
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 32s
CI / test (3.12) (push) Successful in 36s
CI / test (3.10) (pull_request) Successful in 34s
CI / test (3.11) (pull_request) Successful in 32s
CI / test (3.12) (pull_request) Successful in 35s
ecff2b430d
create_vm_from_cloud_init(guest_os=...) with GUEST_AGENTS from
napalm-device-types 3.0 (QEMU_GUEST_AGENTS: Linux, FreeBSD, OpenBSD). An
unknown guest_os is refused before anything is created. Found on FreeBSD
15.1 and OpenBSD 7.9 cloud images (NetOrk/netork#793):

- OS type `other` for the BSDs. OpenBSD's qemu-ga only works over ISA
  serial, and only as the second port: the image keeps its console on
  com0, so the VM gets `serial0: socket` next to `agent: 1,type=isa`.
- A BSD guest gets a network-config v2 snippet of its own
  (`cicustom: user=...,network=...`, MAC read back from net0). FreeBSD's
  nuageinit fails on the v1 Proxmox generates and then skips runcmd,
  which starts the guest agent. Linux keeps Proxmox's own.
- Packed images (FreeBSD's .qcow2.xz) are unpacked on the node after the
  packed file's checksum is verified; only the unpacked file is cached.
  download-url unpacks ISOs only, so they always take the SSH path.

Fixed on the way:
- get_vm_status skipped loopback only when it was called `lo`; OpenBSD's
  agent lists `lo0` first, so 127.0.0.1 would have been the VM's IP.
  Loopback is now recognised by its address.
- destroy_vm read cicustom after deleting the VM, when its config was gone,
  so snippets stayed on the node; it now reads them first and removes all
  of them (#15).
christianmanivong merged commit 363f93c895 into master 2026-10-08 06:05:05 +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-proxmox#16