feat!: a VM's vmid is a string, and its config can describe its hardware #1

Merged
christianmanivong merged 2 commits from feature/vmid-as-string into main 2026-10-01 18:59:36 +00:00
Owner

Summary

Prepares the hypervisor contract for a second hypervisor (VMware, via the new napalm-vmware).

Changes

  • VMDict.vmid / VMConfigDict.vmid: int → str. VMware identifies VMs by UUID; the provisioning dicts were already str.
  • VMConfigDict gains optional hardware fields (os_name, cpu_type, sockets, cores_per_socket, firmware, machine, passthrough as VMPassthroughDict), so netOrk's VM hardware view no longer needs Proxmox's raw config.
  • README hypervisor example uses create_vm_snapshot (was the stale snapshot_create).
  • Version 2.0.0 (breaking type change).

Related

Consumed by NAPALM/napalm-proxmox feature/hypervisor-contract, NAPALM/napalm-vmware and netOrk feature/vmware-driver. Merge this first.

Testing

pytest: 179 passed (new tests/test_vm_identifiers.py). The ruff/mypy findings in untouched files predate this branch.

🤖 Generated with Claude Code

## Summary Prepares the hypervisor contract for a second hypervisor (VMware, via the new `napalm-vmware`). ## Changes - `VMDict.vmid` / `VMConfigDict.vmid`: `int` → `str`. VMware identifies VMs by UUID; the provisioning dicts were already `str`. - `VMConfigDict` gains optional hardware fields (`os_name`, `cpu_type`, `sockets`, `cores_per_socket`, `firmware`, `machine`, `passthrough` as `VMPassthroughDict`), so netOrk's VM hardware view no longer needs Proxmox's raw config. - README hypervisor example uses `create_vm_snapshot` (was the stale `snapshot_create`). - Version 2.0.0 (breaking type change). ## Related Consumed by NAPALM/napalm-proxmox `feature/hypervisor-contract`, NAPALM/napalm-vmware and netOrk `feature/vmware-driver`. Merge this first. ## Testing `pytest`: 179 passed (new `tests/test_vm_identifiers.py`). The ruff/mypy findings in untouched files predate this branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
christianmanivong added 1 commit 2026-09-24 07:06:49 +00:00
VMDict.vmid and VMConfigDict.vmid were int. Proxmox numbers its guests,
but VMware identifies a VM by UUID, which an int cannot hold. The
provisioning dicts already carried vmid as a string; the read side now
matches. Proxmox reports "100".

VMConfigDict gains optional hardware details -- os_name, cpu_type,
sockets, cores_per_socket, firmware, machine and passthrough (PCI/USB,
as VMPassthroughDict) -- so netOrk's VM hardware view can be filled by
any hypervisor instead of reading Proxmox's raw config through the
driver's private API.

Also fixes the README's hypervisor example, which still named the
pre-contract snapshot_create.

BREAKING CHANGE: VMDict.vmid and VMConfigDict.vmid are str.
christianmanivong added 1 commit 2026-09-24 08:00:04 +00:00
HostRebootMixin declares reboot_host(), mixed into DeviceTypeDriver so
any device may be restartable. netOrk restarted hosts by sending
/sbin/reboot through a driver's private _send_command; a driver talking
to an API had no such method and the reboot was silently skipped.

HypervisorDriver gains GUEST_AGENT_PACKAGES / GUEST_AGENT_RUNCMD, the
agent cloud-init installs so the hypervisor can read a new VM's IP.
The default stays qemu-guest-agent; VMware declares open-vm-tools.

NetworkTargetDict.kind may be "portgroup": a VMware port group fixes its
VLAN like an SDN vnet does, without being one.
christianmanivong merged commit 7b491164a2 into main 2026-10-01 18:59:36 +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#1