fix(ablauf): angelegte ID merken, bevor auf Proxmox gewartet wird

Brach das Warten auf Klonen oder Anlegen ab, legte Proxmox den Gast trotzdem fertig an – und „Aufräumen“ wusste nichts von ihm (CT 114 im Feldtest).

Refs #020

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 16:02:57 +02:00
co-authored by Claude Opus 5.5
parent bc13b94c7e
commit ca9d6de446
4 changed files with 64 additions and 50 deletions
+23 -24
View File
@@ -245,31 +245,30 @@ export function lxcAusrollSchritte(e: LxcAusrollEingabe, stand: LxcAusrollStand
ausfuehren: async () => {
if (stand.weg === "gast") bereitstellung = await e.bereitstellung();
const featureListe = [features.nesting ? "nesting=1" : null].filter(Boolean).join(",");
await aufgabeAbwarten(
client,
await client.post<string>(pfad`/nodes/${stand.knoten!}/lxc`, {
vmid: stand.vmid!,
hostname: a.name,
ostemplate: stand.ostemplate!,
ostype: lxc!.ostype,
rootfs: `${a.storage}:${a.diskGb}`,
cores: a.cores,
memory: a.speicherMb,
swap: a.swapMb,
unprivileged: a.unprivilegiert,
...(featureListe ? { features: featureListe } : {}),
net0: lxcNetz(a.netz),
...(a.netz.dns.length > 0 ? { nameserver: a.netz.dns.join(" ") } : {}),
...(a.netz.suchdomain ? { searchdomain: a.netz.suchdomain } : {}),
// Nur der Bereitstellungsschlüssel kommt an root – der Benutzer bekommt seine eigenen Schlüssel.
...(bereitstellung ? { "ssh-public-keys": bereitstellung.oeffentlich } : {}),
onboot: a.startBeiBoot,
tags: ["proxdeploy", d.id, ...a.tags].join(";"),
description: `Ausgerollt mit ProxDeploy (Auftrag ${e.auftragKurzId})\nDistribution: ${d.name}\nProfile: ${e.profile.map((p) => p.profil.id).join(", ") || "–"}`,
}),
{ zeitlimitMs: 15 * 60 * 1000 },
);
const upid = await client.post<string>(pfad`/nodes/${stand.knoten!}/lxc`, {
vmid: stand.vmid!,
hostname: a.name,
ostemplate: stand.ostemplate!,
ostype: lxc!.ostype,
rootfs: `${a.storage}:${a.diskGb}`,
cores: a.cores,
memory: a.speicherMb,
swap: a.swapMb,
unprivileged: a.unprivilegiert,
...(featureListe ? { features: featureListe } : {}),
net0: lxcNetz(a.netz),
...(a.netz.dns.length > 0 ? { nameserver: a.netz.dns.join(" ") } : {}),
...(a.netz.suchdomain ? { searchdomain: a.netz.suchdomain } : {}),
// Nur der Bereitstellungsschlüssel kommt an root – der Benutzer bekommt seine eigenen Schlüssel.
...(bereitstellung ? { "ssh-public-keys": bereitstellung.oeffentlich } : {}),
onboot: a.startBeiBoot,
tags: ["proxdeploy", d.id, ...a.tags].join(";"),
description: `Ausgerollt mit ProxDeploy (Auftrag ${e.auftragKurzId})\nDistribution: ${d.name}\nProfile: ${e.profile.map((p) => p.profil.id).join(", ") || "–"}`,
});
// Sofort merken, nicht erst nach dem Warten: bricht das Warten ab, legt Proxmox den
// Container trotzdem fertig an – „Aufräumen“ muss ihn dann kennen.
await e.angelegt({ vmid: stand.vmid });
await aufgabeAbwarten(client, upid, { zeitlimitMs: 15 * 60 * 1000 });
if (features.keyctl) {
const ssh = e.sshFuer(stand.knoten!)!;
if (!client.trocken) {