feat: implement automated VMID discovery for LXC creation
This commit is contained in:
parent
1536974fcc
commit
b5814e9e61
4 changed files with 35 additions and 4 deletions
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue