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

berlin2123

New Member
Jun 29, 2024
3
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!