Automatic Unlock VM at boot

dnut

Active Member
May 6, 2016
23
7
43
42
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