feat: VMProvisionIncomplete names the VM a failed creation left behind #70

Merged
christianmanivong merged 3 commits from feat/vm-create-partial-failure into main 2026-11-01 22:56:34 +00:00
Owner

Adds VMProvisionIncomplete(RuntimeError) in napalm_device_types/provisioning.py (exported from the package root): raised by create_vm_from_cloud_init when creation fails after a VM exists, carrying vmid and node, with the original error as __cause__. Callers that catch RuntimeError still catch it; __reduce__ keeps it picklable (Celery).

Why: NAPALM/napalm-proxmox#28 — a failure after the VMID was taken left a half-built VM behind. Decision: the caller (netOrk's provisioning rollback) removes it, so the removal is audited; the driver only names it. napalm-vmware can follow later.

Docs: create_vm_from_cloud_init "Raises:" in hypervisor.py, README provisioning paragraph, CHANGELOG [Unreleased] → Added (MINOR).

Tested: tests/test_vm_provision_incomplete.py (failed first). pytest 1044 passed, ruff, mypy clean.

Merge order: this first; release 4.23.0; then napalm-proxmox (floor bump) and netOrk (pins).

Adds `VMProvisionIncomplete(RuntimeError)` in `napalm_device_types/provisioning.py` (exported from the package root): raised by `create_vm_from_cloud_init` when creation fails **after** a VM exists, carrying `vmid` and `node`, with the original error as `__cause__`. Callers that catch `RuntimeError` still catch it; `__reduce__` keeps it picklable (Celery). Why: NAPALM/napalm-proxmox#28 — a failure after the VMID was taken left a half-built VM behind. Decision: the caller (netOrk's provisioning rollback) removes it, so the removal is audited; the driver only names it. napalm-vmware can follow later. Docs: `create_vm_from_cloud_init` "Raises:" in `hypervisor.py`, README provisioning paragraph, CHANGELOG [Unreleased] → Added (MINOR). Tested: `tests/test_vm_provision_incomplete.py` (failed first). pytest 1044 passed, ruff, mypy clean. Merge order: this first; release 4.23.0; then napalm-proxmox (floor bump) and netOrk (pins).
christianmanivong added 1 commit 2026-11-01 21:15:00 +00:00
feat: VMProvisionIncomplete names the VM a failed creation left behind
driver / standard (pull_request) Failing after 17s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m13s
driver / test (3.13) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 37s
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Failing after 3m1s
driver / publish (pull_request) Skipped
4150570a94
create_vm_from_cloud_init raised a plain error once the VM existed, so the
caller had no id to remove it by. The new RuntimeError carries vmid and
node, with the failure as its cause; a failure before the VM exists raises
as before.

Refs NAPALM/napalm-proxmox#28
christianmanivong added 2 commits 2026-11-01 22:43:35 +00:00
# Conflicts:
#	CHANGELOG.md
docs: a tighter create_vm_from_cloud_init docstring
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m7s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / lowest (pull_request) Successful in 35s
driver / test (3.13) (pull_request) Successful in 1m11s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m6s
CI / driver (pull_request) Successful in 2m52s
driver / publish (pull_request) Skipped
73771aba00
The VMProvisionIncomplete entry pushed the method past its recorded
length in the quality baseline. The image-cache note joins the
paragraph it repeated, and the Raises entry takes two lines; nothing
it says is dropped.
christianmanivong merged commit 24f4be3b7e into main 2026-11-01 22:56:34 +00:00
christianmanivong deleted branch feat/vm-create-partial-failure 2026-11-01 22:56:34 +00:00
Sign in to join this conversation.