fix(vm): get_vm_status reads status/current (NetOrk/netork#2696)

get_vm_status answered "running" for every VM whose config could be read
and never asked Proxmox for the VM's state, so a caller waiting for a clean
shutdown never saw the VM stop. It now reads status/current and maps it with
qemu_status, the mapping get_vms() uses: running, stopped, or paused for a
qmpstatus of paused or suspended. The guest agent is asked for an address
only while the VM runs; wait_for_ip ends at once with a RuntimeError when the
VM is stopped or paused.

Closes #72
This commit is contained in:
Christian Manivong committed 2026-11-26 00:21:40 +01:00
1 parent ad3b5b29a9
commit cae4859383
5 files changed
+190 -58

No files matched your search

+2 -2
View File
@@ -20,7 +20,7 @@
"napalm_proxmox/vm_mixin.py::ProxmoxVMMixin.get_vm_interfaces": 37,
"napalm_proxmox/vm_mixin.py::ProxmoxVMMixin.get_vms": 21,
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.create_vm_from_cloud_init": 18,
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.get_vm_status": 16
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.get_vm_status": 12
},
"function_lines": {
"napalm_proxmox/interfaces_mixin.py::ProxmoxInterfaceMixin.get_mac_address_table": 71,
@@ -34,7 +34,7 @@
"napalm_proxmox/vm_mixin.py::ProxmoxVMMixin.get_vms": 114,
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.create_vm_from_cloud_init": 220,
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.destroy_vm": 56,
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.get_vm_status": 92
"napalm_proxmox/vm_provision_mixin.py::ProxmoxVMProvisionMixin.get_vm_status": 63
},
"mypy_relaxed": [
"napalm_proxmox.config_mixin",