If i run the following command in SSH, it works fine
However same command via API2 throws me an error - Agent error: Guest agent command failed, error was 'Failed to execute child process (No such file or directory)'
I am confused how one works via SSH and doesn't via API2.
I suspect API2 is broken for it.
Code:
root@usa01:~# qm guest exec 125 -- cmd.exe /c slmgr.vbs -rearm && shutdown -r
timeout reached, returning pid
{
"pid" : 2968
}
Reboot scheduled for Thu 2024-08-29 10:35:12 EDT, use 'shutdown -c' to cancel.
However same command via API2 throws me an error - Agent error: Guest agent command failed, error was 'Failed to execute child process (No such file or directory)'
Code:
POST https://HOSTNAME:8006/api2/json/nodes/usa01/qemu/125/agent/exec
Array
(
[command] => cmd.exe /c slmgr.vbs -rearm && shutdown -r
)
Duration: 552150 microseconds; 0.55215 seconds
Code:
HTTP 500 HTTP/1.1 500 Agent error: Guest agent command failed, error was 'Failed to execute child process (No such file or directory)'
Cache-Control: max-age=0
Connection: close
Date: Thu, 29 Aug 2024 14:31:38 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0
Content-Length: 13
Content-Type: application/json;charset=UTF-8
Expires: Thu, 29 Aug 2024 14:31:38 GMT
{"data":null}
I am confused how one works via SSH and doesn't via API2.
I suspect API2 is broken for it.