[SOLVED] Unlocking VM via API still not possible?

a113

New Member
Jul 22, 2020
2
0
1
45
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?
 

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!