[SOLVED] sendkey to VM in pool?

cape

New Member
Mar 24, 2019
9
1
1
55
Hi!
I'm experimenting with adding resource pool support for the Packer Proxmox builder, but I'm running into problems that the `sendkey` API call doesn't seem to work for users restricted to a pool (`Permission check failed (/, Sys.Modify) (403)`).
Is this by design, or is it something that could be fixed?

Testing on PVE 5.4-3.
 
what is the exact api call you do? afaics the permission needed is 'VM.Console' on the vmid (which would be true if a user has VM.Console on a pool containing the vm)
 
Ah. I'm calling /api2/json/nodes/{node}/qemu/{vmid}/monitor, with the command parameter set to "sendkey x" for example.
I see there is a sendkey endpoint, but I don't recall why I opted to use the monitor endpoint instead. I have some vague recollection of some issue, but I'll rewrite to use sendkey instead and see if I can make that work.
 
Looks like the problem was that the library I was using to interface with the API didn't implement sendkey. I patched it to have that functionality, and it seems to work fine.
Sorry for the bogus report!