LXC CTID получает внутренний источник vmid

This commit is contained in:
2026-08-09 16:44:09 +03:00
parent e907cf7ef5
commit 9fd8d92abb
+2 -1
View File
@@ -17,7 +17,8 @@ def list_templates() -> dict[str, list[dict]]:
if ct.get("template") != 1:
continue
config = client.nodes(node).lxc(ct["vmid"]).config.get()
lxc_templates.append({"vmid": int(ct["vmid"]), "name": ct.get("name", config.get("hostname", "")), "cores": int(config.get("cores", 1)), "memory_mb": int(config.get("memory", 1024)), "disk_gb": 10, "source_kind": "vmid"})
ct_vmid = int(ct["vmid"])
lxc_templates.append({"vmid": ct_vmid, "volid": f"vmid:{ct_vmid}", "name": ct.get("name", config.get("hostname", "")), "cores": int(config.get("cores", 1)), "memory_mb": int(config.get("memory", 1024)), "disk_gb": 10, "source_kind": "vmid"})
for storage in client.nodes(node).storage.get():
if "vztmpl" not in storage.get("content", ""):