From 8825f9abfeb00c4d94a1668d41b87c3bfb6bb211 Mon Sep 17 00:00:00 2001 From: nexxo Date: Sat, 25 Jul 2026 12:48:58 +0200 Subject: [PATCH] fix(engine-b): Proxmox config uses PUT; guest-agent exec is form-encoded Co-Authored-By: Claude Opus 4.8 --- app/Services/Proxmox/HttpProxmoxClient.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Services/Proxmox/HttpProxmoxClient.php b/app/Services/Proxmox/HttpProxmoxClient.php index 3d256a0..a89541b 100644 --- a/app/Services/Proxmox/HttpProxmoxClient.php +++ b/app/Services/Proxmox/HttpProxmoxClient.php @@ -64,7 +64,8 @@ class HttpProxmoxClient implements ProxmoxClient public function setCloudInit(string $node, int $vmid, array $params): void { - $this->http()->asForm()->post("/nodes/{$node}/qemu/{$vmid}/config", $params)->throw(); + // PUT is the (synchronous) VM config-update operation in Proxmox. + $this->http()->asForm()->put("/nodes/{$node}/qemu/{$vmid}/config", $params)->throw(); } public function resizeDisk(string $node, int $vmid, string $disk, string $size): void @@ -96,9 +97,9 @@ class HttpProxmoxClient implements ProxmoxClient public function guestExec(string $node, int $vmid, string $command): array { // The guest agent runs a program directly, not a shell — wrap compound - // commands (cd/&&/pipes/redirects/env) in an explicit shell. command is a - // JSON array so each argument is passed safely without re-quoting. - $pid = $this->http() + // commands (cd/&&/pipes/redirects/env) in an explicit shell. Proxmox is + // form-encoded and takes `command` as an argv list. + $pid = $this->http()->asForm() ->post("/nodes/{$node}/qemu/{$vmid}/agent/exec", ['command' => ['/bin/sh', '-c', $command]]) ->throw()->json('data.pid');