Archived
LXC CTID получает внутренний источник vmid
This commit is contained in:
@@ -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", ""):
|
||||
|
||||
Reference in New Issue
Block a user