Issue with Proxmox 8.2.4 & qemu-guest-agent

Sherbs

New Member
Jul 10, 2024
3
1
3
Hi, I've recently upgraded from Proxmox 7 to Proxmox 8.2.4 and I'm running into an issue with running commands on a VM using QEMU Guest Agent using API calls.

This previously worked fine on Proxmox 7 but does not work anymore on Proxmox 8.2.4

What DOES work:
- API Calls to proxmox, e.g. get PVE Version: https://{{hostname}}:8006/api2/json/version (or rebooting VM etc.)
{
"data": {
"version": "8.2.4",
"release": "8.2",
"repoid": "faa83925c9641325"
}
}


What does NOT work:
- Executing a command on the VM using QEMU Guest agent: https://{{hostname}}:8006/api2/json/nodes/{{nodename}}/qemu/{{vmid}}/agent/exec
- I get the HTTP Status code "596" back, and time to complete request is rather high (> 5s). In Proxmox 7 I used to get back status code 200 OK when doing exactly the same call.

in the journalctl of the VM I can see that the command arrived but it does not get executed (here I try to initiate a reboot of the VM)

Jul 11 12:30:29 eylab0 qemu-ga[437]: info: guest-ping called
Jul 11 12:30:29 eylab0 qemu-ga[437]: info: guest-exec called: "sudo reboot -h now"


This used to work perfectly on Proxmox 7. For automation purposes I depend on running commands using the API on VMs, proved to be very efficient.

QEMU Guest Agent on VM is enabled. I initially noticed the failre on my debian 11 VMs, I then tried on a freshly installed debian 12 VM but noticed the identical behaviour.

Any ideas?
 
if the guest agent inside the VM logs that it received the command, then I don't think the issue is on our end? can you try with a simple command like 'whoami'?
 
Thanks for your quick reply. Simple command indeed work. However, the parameters are somehow now passed differently. I'm using postman and was able to pass the command (including spaces) in the "Value" field.

If I put a simple command in the "Value" field it works, but not with spaces (reboot work, but not reboot -h now)
pveapi_postman.jpg

Exactly this command worked in the Proxmox 7...
 
see the PVE 8.0 release notes:

https://pve.proxmox.com/wiki/Roadmap#Proxmox_VE_8.0

API​


  • The API can handle array-type data differently, while trying staying backward compatible.Instead of being able to pass the individual elements separated by null bytes, you can pass the data directly as array.
  • Before Proxmox VE 8, the API endpoint to trigger a QEMU guest agent (QGA) command execution (/nodes/{node}/qemu/{vmid}/agent/exec) allowed passing a command as a single string, which would then be automatically split at whitespace. This was deemed too brittle and is not supported anymore. You must now send the command and all its arguments as a proper array of strings.
 
Thanks for your reply, i then will have to change the API call, which should solve the issue.
 
  • Like
Reactions: fabian

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!