Automatic Unlock VM at boot

dnut

Active Member
May 6, 2016
23
6
43
41
Hello,
I'm having some issues with a particular Proxmox 4.4 Server:
sometimes prolonged power outages happen during VZDump operations, causing proxmox to shutdown, and so resulting in a locked VM which of course doesn't start at the next boot.

Is there a way to automatically unlock VM at boot, so they regulary boot, regardless what happened before?

I'm thinking to automate some simple script at boot with "qm unlock ***" or similar, is there any drawback doing this?
 
Last edited:
prolonged power outages
You mean, longer then your UPS holds? ;)

You can add the qm unlock, but it might trigger after the system tried to start the VM and you don't know if the VM/CT is in a working state. I think, manual intervention is always needed.
 
From the man page:
LOCKS
Online migrations, snapshots and backups (vzdump) set a lock to prevent incompatible concurrent actions on the affected VMs. Sometimes you need to remove such a lock manually (e.g., after a power
failure).

qm unlock <vmid>

Caution
Only do that if you are sure the action which set the lock is no longer running.
 
Hello,
I'm having some issues with a particular Proxmox 4.4 Server:
sometimes prolonged power outages happen during VZDump operations, causing proxmox to shutdown, and so resulting in a locked VM which of course doesn't start at the next boot.

Is there a way to automatically unlock VM at boot, so they regulary boot, regardless what happened before?

I'm thinking to automate some simple script at boot with "qm unlock ***" or similar, is there any drawback doing this?

FYI, backup locks get automatic cleared for startup since PVE 5.0 and for PVE 4.4 it's in the source code repository but not yet released as package.
As the safeness of a left over lock removal is very dependent on what happend we only enabled it for backup locks atm.
 
  • Like
Reactions: dnut
FYI, backup locks get automatic cleared for startup since PVE 5.0 and for PVE 4.4 it's in the source code repository but not yet released as package.
As the safeness of a left over lock removal is very dependent on what happend we only enabled it for backup locks atm.

That looks awesome,

Thank you
 

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!