feat: implement automated VMID discovery for LXC creation

This commit is contained in:
Fredrick Amnehagen 2026-02-06 08:36:38 +01:00
parent 1536974fcc
commit b5814e9e61
4 changed files with 35 additions and 4 deletions

View file

@ -22,6 +22,14 @@ class ProxmoxManager:
res = self.client.run(f"pct status {vmid}")
return res.stdout
def get_next_vmid(self):
"""Retrieves the next available cluster-wide VMID from Proxmox"""
res = self.client.run("pvesh get /cluster/nextid")
if res.returncode == 0 and res.stdout.strip():
return res.stdout.strip()
# Fallback if pvesh fails (highly unlikely on PVE)
return None
def resolve_template(self, alias):
"""Resolves a template alias (e.g. 'debian-13') to the latest full path on the node"""
if alias == "debian-13":