24 lines
657 B
Bash
Executable file
24 lines
657 B
Bash
Executable file
#!/bin/bash
|
|
set -x
|
|
timestamp=`date '+%Y-%m-%d-%H-%M'`
|
|
vmname=deb11-image-$timestamp.template
|
|
|
|
|
|
wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2
|
|
|
|
qm destroy 9000
|
|
|
|
qm create 9000 --cores 2 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --name $vmname
|
|
qm set 9000 --scsi0 local-lvm:0,import-from=/root/debian-11-genericcloud-amd64.qcow2
|
|
qm set 9000 --ide2 local-lvm:cloudinit
|
|
qm set 9000 --boot order=scsi0
|
|
qm set 9000 --agent enabled=1
|
|
qm set 9000 --ostype l26
|
|
qm set 9000 --serial0 socket --vga serial0
|
|
qm resize 9000 scsi0 +14G
|
|
|
|
qm template 9000
|
|
|
|
rm debian-11-genericcloud-amd64.qcow2
|
|
|
|
set +x
|