Changed disk format to qcow2

This commit is contained in:
root 2024-01-27 18:47:00 +02:00
parent 1eac046bd9
commit 0182726789
2 changed files with 5 additions and 1 deletions

View File

@ -1,2 +1,4 @@
* <https://github.com/Azure/azhpc-images/issues/305> * <https://github.com/Azure/azhpc-images/issues/305>
* <https://pve.proxmox.com/pve-docs/qm.1.html> * <https://pve.proxmox.com/pve-docs/qm.1.html>
* <https://gtgb.io/2022/07/23/proxmox-vm-templating/>
* <https://4sysops.com/archives/using-the-qcow2-disk-format-in-proxmox/>

View File

@ -50,9 +50,10 @@ function createImage() {
qm create ${IMAGE_ID} --name "${IMAGE_NAME}" --memory ${IMAGE_RAM} --cores ${IMAGE_CORES} \ qm create ${IMAGE_ID} --name "${IMAGE_NAME}" --memory ${IMAGE_RAM} --cores ${IMAGE_CORES} \
--net0 virtio,bridge=vmbr0 --net0 virtio,bridge=vmbr0
qm importdisk ${IMAGE_ID} ${IMAGE_FILE} ${IMAGE_STORE} qm importdisk ${IMAGE_ID} ${IMAGE_FILE} ${IMAGE_STORE} --format qcow2
qm set ${IMAGE_ID} --cpu cputype=x86-64-v2 qm set ${IMAGE_ID} --cpu cputype=x86-64-v2
qm set ${IMAGE_ID} --scsihw virtio-scsi-pci --scsi0 ${IMAGE_STORE}:vm-${IMAGE_ID}-disk-0 qm set ${IMAGE_ID} --scsihw virtio-scsi-pci --scsi0 ${IMAGE_STORE}:vm-${IMAGE_ID}-disk-0
# qm resize ${IMAGE_ID} virtio0 +15G
qm set ${IMAGE_ID} --boot c --bootdisk scsi0 qm set ${IMAGE_ID} --boot c --bootdisk scsi0
qm set ${IMAGE_ID} --ide2 ${IMAGE_STORE}:cloudinit qm set ${IMAGE_ID} --ide2 ${IMAGE_STORE}:cloudinit
@ -70,6 +71,7 @@ function createImage() {
qm set ${IMAGE_ID} --ipconfig0 ip=dhcp qm set ${IMAGE_ID} --ipconfig0 ip=dhcp
qm set ${IMAGE_ID} --agent enabled=1 qm set ${IMAGE_ID} --agent enabled=1
qm set ${IMAGE_ID} --sshkeys ${SSH_KEYS_FILE} qm set ${IMAGE_ID} --sshkeys ${SSH_KEYS_FILE}
# qm template ${IMAGE_ID}
rm -vf "${IMAGE_FILE}" rm -vf "${IMAGE_FILE}"
} }