Find VM's with lock

May 20, 2019
2
0
21
50
Netherlands
We're backing up VM's to a NFS device over an IPSEC tunnel. Sometimes the tunnel disappaers for a short time and the backup hangs (which is understandable).
But; next day some VM's cannot be backupped since they 're locked.
Is it possible to find all locked VM's using the API or the "qm status" command ?
 
You need "jq" (apt install jq) for this.

Code:
pvesh get /nodes/$(hostname)/qemu --output-format=json | jq -cr '.[] | select(.["lock"]) | .["vmid"]'
This will return the ID of locked VMs
 

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!