update debian template

This commit is contained in:
Adora Laura Kalb 2024-11-29 10:27:54 +01:00
parent 257ea183c5
commit 99d196a891
Signed by: adoralaura
SSH key fingerprint: SHA256:3XrkbR8ikAZJVtYfaUliX1MhmJYVAe/ocIb/MiDHBJ8

View file

@ -1,24 +1,23 @@
#!/bin/bash #!/bin/bash
set -x set -x
timestamp=`date '+%Y-%m-%d-%H-%M'` vmid=9001
vmname=deb11-image-$timestamp.template timestamp=$(date '+%Y-%m-%d-%H-%M')
vmname=debian-12-$timestamp.template.net
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2 -O debian-genericcloud-amd64.qcow2
qm destroy ${vmid}
wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2 qm create ${vmid} --cores 2 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --name $vmname
qm destroy 9000 qm set ${vmid} --scsi0 pve:0,import-from=/root/debian-genericcloud-amd64.qcow2
qm set ${vmid} --ide2 pve:cloudinit
qm set ${vmid} --boot order=scsi0
qm set ${vmid} --agent enabled=1
qm set ${vmid} --ostype l26
qm set ${vmid} --serial0 socket --vga serial0
qm resize ${vmid} scsi0 +6G
qm create 9000 --cores 2 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --name $vmname qm template ${vmid}
qm set 9000 --scsi0 local-lvm:0,import-from=/root/debian-11-genericcloud-amd64.qcow2 rm debian-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 set +x