get_vm_status always reports "running" for an existing VM #72

Closed
opened 2026-11-25 21:11:05 +00:00 by christianmanivong · 0 comments
Owner

Priority: P2 (important and urgent). netOrk's workflow step "Shut down Proxmox VM" can never see a VM stop, so it always runs into its timeout. The "Proxmox status" source reports every existing VM as running.

What happens

get_vm_status(vmid) (napalm_proxmox/vm_provision_mixin.py:866-948, at netOrk's pin 449230c) never reads the VM's state:

  • When the VM's config cannot be read, it returns {"status": "unknown"}.
  • Otherwise it tries the guest agent's network-get-interfaces. On an IPv4 address it returns "running". Without wait_for_ip it then returns {"status": "running"} at once, whatever the VM's actual state, stopped included (line 948).

status/current (status: running|stopped, qmpstatus) is never asked.

Effect in netOrk

  • The workflow node source.proxmox_status (src/netork/core/workflows/graph/devices.py:194-204) reports "running" for a stopped VM.
  • _proxmox_shutdown_vm (:244-266) asks for a clean shutdown and then waits for "stopped". It only ever sees "running", so it takes the timeout port after timeout_minutes, even when the VM stopped within seconds. Workflows that shut guests down before a node goes off (#1633) wait the full timeout and then follow the timeout branch.

Expected

get_vm_status reads GET /nodes/{node}/qemu/{vmid}/status/current. status is stopped/running, and paused for qmpstatus: paused/suspended, matching get_vms() since NetOrk/netork#2658. The guest-agent IP lookup runs only for a running VM. A test asserts that a stopped fixture gives "stopped".

Found while working on NetOrk/netork#2658.

Priority: P2 (important and urgent). netOrk's workflow step "Shut down Proxmox VM" can never see a VM stop, so it always runs into its timeout. The "Proxmox status" source reports every existing VM as running. ## What happens `get_vm_status(vmid)` (`napalm_proxmox/vm_provision_mixin.py:866-948`, at netOrk's pin 449230c) never reads the VM's state: - When the VM's config cannot be read, it returns `{"status": "unknown"}`. - Otherwise it tries the guest agent's `network-get-interfaces`. On an IPv4 address it returns `"running"`. Without `wait_for_ip` it then returns `{"status": "running"}` at once, whatever the VM's actual state, stopped included (line 948). `status/current` (`status: running|stopped`, `qmpstatus`) is never asked. ## Effect in netOrk - The workflow node `source.proxmox_status` (`src/netork/core/workflows/graph/devices.py:194-204`) reports `"running"` for a stopped VM. - `_proxmox_shutdown_vm` (`:244-266`) asks for a clean shutdown and then waits for `"stopped"`. It only ever sees `"running"`, so it takes the `timeout` port after `timeout_minutes`, even when the VM stopped within seconds. Workflows that shut guests down before a node goes off (#1633) wait the full timeout and then follow the timeout branch. ## Expected `get_vm_status` reads `GET /nodes/{node}/qemu/{vmid}/status/current`. `status` is `stopped`/`running`, and `paused` for `qmpstatus: paused`/`suspended`, matching `get_vms()` since NetOrk/netork#2658. The guest-agent IP lookup runs only for a running VM. A test asserts that a stopped fixture gives `"stopped"`. Found while working on NetOrk/netork#2658.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-proxmox#72