[SOLVED] Unlocking VM via API still not possible?

a113

New Member
Jul 22, 2020
2
0
1
46
I want to set the config setting "lock" from the API docs to be empty (something like POST lock='') to remove it via the API.

At least in 2016 this seems to not have been possible. Is there a way that doesn't need root privileges?
 
passing 'delete=lock' and 'skiplock=1' to the PUT/POST config API endpoint should do the trick (but only as root@pam)
 
  • Like
Reactions: a113
Thank you for the swift response.

The first part sounds perfect, but I still wonder how I should make my service account delete those locks. It doesn't have root rights naturally.

It just happens from time to time that a Proxmox process like rollback or snapshot-create couldn't be finished and then the vm is locked until a friendly root helps out the service account.
 
the problem is that when such a lock is left-over, it means that error handling somehow failed. in that case, an admin should take a look at the failed task, remove any leftovers, and then unlock, since something could be in an inconsistent state.
 
  • Like
Reactions: a113
passing 'delete=lock' and 'skiplock=1' to the PUT/POST config API endpoint should do the trick (but only as root@pam)
Need to ask as I'm hitting similar (via stop) that it MUST be a root@pam "login" (ie. going throught the api_user + password getting a "ticket" and then doing the API calls with that ticket) and NOT an api token (ie, root@pam!tokenName), correct?