api context lock cannot be undone

alexskysilk

Distinguished Member
Oct 16, 2015
2,352
640
183
Chatsworth, CA
www.skysilk.com
In the API reference, context set /api2/json/nodes/{node}/lxc/{vmid}/config/lock should be able to reset a container's lock flag, but actually issuing the command errors out with

no 'set' handler for 'nodes/nodeid/lxc/ctid/config/lock'

Does this context work, and what am I doing wrong?
 
Can you try something like:

Code:
pvesh set /nodes/NODEID/lxc/CTID/config -delete lock

A bit non-intuitive at first. config has no lock subpath and secondly you could only use the lock parameter to set a new lock not to clear one completely, that holds true for all config parameters.
Maybe we could add sub paths for properties and allow a delete on them... then "pvesh delete /nodes/NODEID/lxc/CTID/config/lock" could work.
 
issuing the command

pvesh set /nodes/NODEID/lxc/CTID/config -delete lock

results in "CT is locked (snapshot-delete)"

actual lock state isnt removed. Incidentally, this container is locked for a snapshot-delete but no snapshot task is pending, which is how this odyssey started.
 
you can add the '-skiplock' parameter to the api call of deleting the lock
 
mhmm yeah you are right ( i looked at the qemu api calls and not the container ones)
at the moment for containers it is only possible to unlock it via 'pct unlock VMID'