From ce062972f46e858427ab8af142ce9f793f52948a Mon Sep 17 00:00:00 2001 From: host Date: Sun, 9 Aug 2026 16:44:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BE=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20LXC=20=D0=B8=D0=B7=20CTID-=D1=88=D0=B0=D0=B1?= =?UTF-8?q?=D0=BB=D0=BE=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/proxmox_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/proxmox_client.py b/backend/app/proxmox_client.py index 0822f9a..4b53e41 100644 --- a/backend/app/proxmox_client.py +++ b/backend/app/proxmox_client.py @@ -64,7 +64,9 @@ def provision_lxc_clone(source_vmid: int, vmid: int, name: str, cores: int, memo def provision_lxc(source_template: str, vmid: int, name: str, cores: int, memory_mb: int, disk_gb: int, password: str) -> None: - """Создаёт LXC из архивного CT-шаблона и запускает его.""" + """Создаёт LXC из архива или клонирует LXC-шаблон по внутреннему vmid:ID.""" + if source_template.startswith("vmid:"): + return provision_lxc_clone(int(source_template.split(":", 1)[1]), vmid, name, cores, memory_mb, disk_gb, password) client = _client(); node = settings.pve_node upid = client.nodes(node).lxc.post(vmid=vmid, hostname=name, ostemplate=source_template, cores=cores, memory=memory_mb, swap=memory_mb, rootfs=f"{settings.pve_lxc_storage}:{disk_gb}", password=password, net0=f"name=eth0,bridge={settings.pve_bridge},ip=dhcp", unprivileged=1) _wait_task(client, node, upid)