mirror of
https://github.com/Corsinvest/cv4pve-api-powershell.git
synced 2026-04-25 12:15:48 +03:00
[GH-ISSUE #45] Unlock-PveVm does not work because of pipelined VM Data #28
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cv4pve-api-powershell#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @r3st0r3 on GitHub (Dec 19, 2025).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-powershell/issues/45
What happened?
The function Unlock-PveVm does not work. Executing with a locked vm (example ID 115) returns an error.
To reproduce lock the vm manually via SSH:
qm set 115 --lock createThen after connection to your cluster run:
Unlock-PveVm -PveTicket $myCluster -VmIdOrName 115Details of Parameters of Return (parameters that the api received from my side)
I wondered some time where the values lock, cpu and template come from as the call of Set-PveNodesQemuConfig does not set them (process part of Unlock-PveVm):
They come from the Pipelining of $vm! For example my variable $vm looks like
To fix please change the process part of the function to
This will prevent the takeover of values from the vm-variable from the line before.
Unfortunately I do not have an lxc to test. I think this line also needs to be changed to not be filled with pipeline-values.
Expected behavior
Response : @{data=}
StatusCode : 200
ReasonPhrase :
IsSuccessStatusCode : True
RequestResource : /nodes/xpve17/qemu/115/config
Parameters : {[skiplock, True], [delete, lock]}
Method : Put
ResponseType : json
Relevant log output
Proxmox VE Version
9.1
Module Version
9.1.0
PowerShell Version
7.4.13
Version (working)
No response
On what operating system are you experiencing the issue?
Windows
Pull Request
@r3st0r3 commented on GitHub (Dec 19, 2025):
Please note also: I corrected the usage of the boolean parameter -Skiplock to -Skiplock:$true because of the error message: