Hi all,
I used the 8.4.0 api(
When the command contains Chinese characters,the execution result would be:
reasonPhrase is "
When re-executing the same command via the API,the result becomes:
reasonPhrase is "
However,checking the agent status in the VM with "
After executing "
I used the 8.4.0 api(
POST /api2/json/nodes/{node}/qemu/{vmid}/agent/exec
) to execute a shell script in the VM.When the command contains Chinese characters,the execution result would be:
JSON:
{
"error": "",
"methodType": "CREATE",
"reasonPhrase": "VM 108 qmp command 'guest-exec' failed - got timeout",
"requestParameters": {
"command": [
"/bin/bash",
"-c",
"cd /home && wget -q --no-check-certificate \"http://172.18.7.21:19001/zkxy-eda-edu-fileupload/ip/8cb27b96-3a90-44b7-9453-9de3f2073e57.pdf\" -O \"学生一-202506170081-实验报告 (1).pdf\" && chmod +777 \"学生一-202506170081-实验报告 (1).pdf\""
]
},
"requestResource": "/nodes/pve1/qemu/108/agent/exec",
"response": {},
"responseType": "JSON",
"statusCode": 500,
"successStatusCode": false
}
VM 108 qmp command 'guest-exec' failed - got timeout
".When re-executing the same command via the API,the result becomes:
JSON:
{
"error": "",
"methodType": "CREATE",
"reasonPhrase": "QEMU guest agent is not running",
"requestParameters": {
"command": [
"/bin/bash",
"-c",
"cd /home && wget -q --no-check-certificate \"http://172.18.7.21:19001/zkxy-eda-edu-fileupload/ip/8cb27b96-3a90-44b7-9453-9de3f2073e57.pdf\" -O \"学生一-202506170081-实验报告 (1).pdf\" && chmod +777 \"学生一-202506170081-实验报告 (1).pdf\""
]
},
"requestResource": "/nodes/pve1/qemu/108/agent/exec",
"response": {},
"responseType": "JSON",
"statusCode": 500,
"successStatusCode": false
}
QEMU guest agent is not running
".However,checking the agent status in the VM with "
systemctl status qemu-guest-agent
",show it as "active(running)
":
Bash:
[root@zouxd /]# systemctl status qemu-guest-agent
● qemu-guest-agent.service - QEMU Guest Agent
Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-07-28 10:51:59 CST; 1min 26s ago
Main PID: 24587 (qemu-ga)
CGroup: /system.slice/qemu-guest-agent.service
└─24587 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist= -F/etc/qemu-ga/fsfreeze-hook
Jul 28 10:51:59 zouxd systemd[1]: Stopped QEMU Guest Agent.
Jul 28 10:51:59 zouxd systemd[1]: Started QEMU Guest Agent.
Jul 28 10:52:07 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:52:08 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:52:19 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:52:30 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:52:40 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:52:50 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:53:01 zouxd qemu-ga[24587]: info: guest-ping called
Jul 28 10:53:11 zouxd qemu-ga[24587]: info: guest-ping called
[root@zouxd /]#
After executing "
systemctl restart qemu-guest-agent
" to restart the agent, its status is fully restored.