fix(engine-b): Proxmox config uses PUT; guest-agent exec is form-encoded
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>feat/portal-design
parent
778bb7f117
commit
8825f9abfe
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue