Added tag to created vm
This commit is contained in:
parent
db1f56d58c
commit
e21df4e0f5
@ -25,12 +25,14 @@ def importTemplate(name, storage, id):
|
||||
file = f"/tmp/{file}"
|
||||
print(f"Importing {file} to {storage} with id {id}")
|
||||
templateName = os.path.basename(file).split(".")[0]
|
||||
os.popen(f'qm create {id} --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --name "{templateName}" | cut -d"." -f1').read()
|
||||
os.popen(f'qm create {id} --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --name "{templateName}" --tag temlate').read()
|
||||
os.popen(f'qm set {id} --scsi0 {storage}:0,import-from={file}').read()
|
||||
os.popen(f'qm set {id} --ide2 {storage}:cloudinit').read()
|
||||
os.popen(f'qm set {id} --boot order=scsi0').read()
|
||||
os.popen(f'qm set {id} --serial0 socket --vga serial0').read()
|
||||
os.popen(f'qm template {id}').read()
|
||||
# add a tag to the vm
|
||||
|
||||
|
||||
def generateMenuOptions():
|
||||
ImagesList = getImagesList()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user