From a8fcc689d32c920611571db0f536ecf3cec0e106 Mon Sep 17 00:00:00 2001 From: host Date: Sun, 9 Aug 2026 16:14:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20VM=20=D0=B8=20LXC=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20Proxmox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/proxmox_actions.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backend/app/proxmox_actions.py diff --git a/backend/app/proxmox_actions.py b/backend/app/proxmox_actions.py new file mode 100644 index 0000000..04ed96b --- /dev/null +++ b/backend/app/proxmox_actions.py @@ -0,0 +1,14 @@ +from .proxmox_client import _client, _wait_task +from .config import settings + + +def delete_guest(guest_type: str, vmid: int) -> None: + """Удаляет VM или LXC и ожидает завершения задачи Proxmox.""" + client = _client() + node = settings.pve_node + if guest_type == "vm": + upid = client.nodes(node).qemu(vmid).delete() + else: + upid = client.nodes(node).lxc(vmid).delete() + if upid: + _wait_task(client, node, upid)