[SOLVED] Is there a quick command to detect VMs suspended (Hibernated) status?

berlin2123

New Member
Jun 29, 2024
5
0
1
I want to check if the VM is in suspended state from the command line.

Here is my way right now:
Code:
qm status <vmid> --verbose | grep suspended
It will have a line in output, if this <vmid> is suspended.

However, this way is tooooo slow. The qm status command will use near 1 second. if there have 100 stoped VMs ( pre-checked by qm list ), just check suspended, will use 100 seconds. This way is terrible.

So, any better way to check all VMs: does they are suspended ?

ps.:
qm list --full will not show does a vm is suspended or not.
 
Last edited:
Yes.

`Passed` could be checked by the output of qm list --full . However Hibernated not.

Hibernated by qm suspend <vmid> --todisk