[SOLVED] QEMU guest agent

Fablux

New Member
Mar 3, 2020
6
0
1
125
HI all,
I'm using your API into my PHP client.
I'm trying to execute this steps:
  1. Clone VM: /api2/json/nodes/{node}/qemu/{vmid}/clone (OK)
  2. Config IP,Gateway and "QEMU enabled" property: /api2/json/nodes/{node}/qemu/{vmid}/config (OK)
  3. Start VM: /api2/json/nodes/{node}/qemu/{vmid}/status/start (OK)
  4. Execute custom script: /api2/json/nodes/{node}/qemu/{vmid}/agent/exec (KO)
The fourth step failed with this error:
"QEMU guest agent is not running" (status: 500).
Where is the error?

I hope I was clear.

Thank you in advance.
 
the qemu guest agent starts with the guest

so before step 4 wait at least 60 seconds for the vm to start or check if the agent is running

this also requires to install the qemu agent within the guest os if not done
 
another approach is to use the ping command and try as long as you get nothing back ... or fail after 5 oder 10 minutes.

Hi LnxBil,
I tryed with the 'ping' API command and it works!
Thank you very much!