Once qemu.post has created the VM shell, any later failure in create_vm_from_cloud_init (disk import/storage, NIC config, snippet storage, cloud-init config, start) raises VMProvisionIncomplete(…, vmid=…, node=…) from napalm-device-types, with the original error as its cause. Failures before a VM exists raise as before. The driver does not clean up itself — netOrk's rollback removes the VM and audits it.
Behaviour change: ValueErrors raised after the shell exists now arrive as the __cause__ of VMProvisionIncomplete (a RuntimeError, as the contract already states).
The NIC config building moved into a pure helper _nic_config_args(); the ratchet baseline shrinks (complexity 25→18, lines 232→220).
Depends on napalm-device-types feat/vm-create-partial-failure (VMProvisionIncomplete). The device-types floor must be raised to the release containing it (4.23.0) before this merges, or the lowest CI job fails.
Once `qemu.post` has created the VM shell, any later failure in `create_vm_from_cloud_init` (disk import/storage, NIC config, snippet storage, cloud-init config, start) raises `VMProvisionIncomplete(…, vmid=…, node=…)` from napalm-device-types, with the original error as its cause. Failures before a VM exists raise as before. The driver does not clean up itself — netOrk's rollback removes the VM and audits it.
Behaviour change: `ValueError`s raised after the shell exists now arrive as the `__cause__` of `VMProvisionIncomplete` (a `RuntimeError`, as the contract already states).
The NIC config building moved into a pure helper `_nic_config_args()`; the ratchet baseline shrinks (complexity 25→18, lines 232→220).
**Depends on** napalm-device-types `feat/vm-create-partial-failure` (VMProvisionIncomplete). The device-types floor must be raised to the release containing it (4.23.0) before this merges, or the `lowest` CI job fails.
Tested: fixtures only, `tests/test_vm_half_built.py` (three failed first). pytest 392 passed, ruff, mypy, `napalm-standard check`/`ratchet` green.
Closes #28
A failure after the VM shell existed (disk import, NIC or snippet config,
start) raised without the VMID, so the caller could not remove the
half-built VM and it stayed on the node. It now raises napalm-device-types'
VMProvisionIncomplete with vmid and node, the failure as its cause. A
failure before the shell exists raises as before.
The NIC config strings are built by a helper of their own, which keeps
create_vm_from_cloud_init within its quality baseline.
Closes#28
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Once
qemu.posthas created the VM shell, any later failure increate_vm_from_cloud_init(disk import/storage, NIC config, snippet storage, cloud-init config, start) raisesVMProvisionIncomplete(…, vmid=…, node=…)from napalm-device-types, with the original error as its cause. Failures before a VM exists raise as before. The driver does not clean up itself — netOrk's rollback removes the VM and audits it.Behaviour change:
ValueErrors raised after the shell exists now arrive as the__cause__ofVMProvisionIncomplete(aRuntimeError, as the contract already states).The NIC config building moved into a pure helper
_nic_config_args(); the ratchet baseline shrinks (complexity 25→18, lines 232→220).Depends on napalm-device-types
feat/vm-create-partial-failure(VMProvisionIncomplete). The device-types floor must be raised to the release containing it (4.23.0) before this merges, or thelowestCI job fails.Tested: fixtures only,
tests/test_vm_half_built.py(three failed first). pytest 392 passed, ruff, mypy,napalm-standard check/ratchetgreen.Closes #28