mirror of
https://github.com/luthermonson/go-proxmox.git
synced 2026-04-26 17:35:48 +03:00
[GH-ISSUE #139] VirtualMachine.IsRunning and VirtualMachine.IsStopped unconditionally rely on fields that VirtualMachine may not have #32
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-proxmox#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @brandonllocke on GitHub (Mar 30, 2024).
Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/139
Starting this issue with the full disclosure that I know enough Go and enough Proxmox to be dangerous, but not much more than that.
It seems that the
VirtualMachinetype is written in such a way that it is not necessarily expected to always get a value for QMPStatus:But the
VirtualMachine.IsRunning()andVirtualMachine.IsStopped()functions (and likely others) essentially require QMPStatus to be set to work.As such (for reasons not clear to me), I have VMs on my Proxmox server that are not returning anything for QMPStatus, so
IsRunning()always returnsfalsedespite the fact that the VMs are running.Should this be checking for empty values before comparing QMPStatus? If so, I am willing to try to make a PR for that. I Just wanted to make sure I'm not misunderstanding what is happening before I attempt that.
Thanks!
@justinclift commented on GitHub (Apr 18, 2024):
It kind of sounds like that might really be the core problem which needs fixing? 😄
@brandonllocke commented on GitHub (Apr 18, 2024):
I can't say much for certain as the documentation on what that value actually means is not very clear, but it does appear QMPStatus is optional, so it being required to determine if a VM is running/stopped/etc. feels like a bug. I'm open to being wrong.
@luthermonson commented on GitHub (Apr 19, 2024):
ya so that's leaning towards the client having a bug and we shouldnt check QMPStatus in that func and others