Finish clone_template function

This commit is contained in:
Александр Степченко 2023-03-27 15:51:32 +03:00
parent b9717e173c
commit c44d13f532

19
main.py
View File

@ -63,13 +63,26 @@ def delete_vm(
def clone_template(
proxmox,
node,
vmid,
newid=None,
node: str,
vmid: int,
newid: int = None,
prefix: int ='stepchenkoas',
):
if newid is None:
newid = proxmox.cluster.get('nextid')
return proxmox.nodes(node).qemu(vmid).clone.post(
newid=newid,
node=node,
vmid=vmid,
format='raw',
full=1,
name=f'{prefix}-test-clone',
pool='Virt_LAB',
storage='rbd-storage',
target=node,
)
def main():
proxmox = ProxmoxAPI(