VM Backup and locks

cosycon

New Member
Oct 28, 2010
8
0
1
Hi, this is a known situation. If a VM is being backed-up (or being migrated or suffered from a power outtage), a lock is placed. If a backup has failed, the lock stays and can be 'removed' by executing 'qm unlock <vmid>'.
Now i have 2 questions:
1: Is there a way to determine if a VM is currently locked?
2: Is it safe to use a script that alway starts with a 'qm unlock <vmid>' command before starting the actual backup?

Of course, afterwards a check must be done to see if the backup has succeeded. I just want to increase the possibility of executing valid backups.

Thanks in advance.
 
1: Is there a way to determine if a VM is currently locked?

# egrep '^lock: backup$' /etc/qemu-server/<vmid>.conf;

2: Is it safe to use a script that alway starts with a 'qm unlock <vmid>' command before starting the actual backup?

no (another backup may be running). But is is safe to remove the lock at host startup.
 

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!