Добавлено удаление VM и LXC через Proxmox

This commit is contained in:
2026-08-09 16:14:01 +03:00
parent da9a087785
commit a8fcc689d3
+14
View File
@@ -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)