18 lines
785 B
Bash
Executable File
18 lines
785 B
Bash
Executable File
#!/bin/bash
|
|
|
|
OSV="13"
|
|
export VMCIID="913"
|
|
FILE="debian-$OSV-genericcloud-amd64.qcow2"
|
|
wget https://cloud.debian.org/images/cloud/trixie/latest/$FILE
|
|
FILETS=$(ls -lh debian-$OSV-genericcloud-amd64.qcow2 | cut -c 24-)
|
|
timestamp=$(date)
|
|
|
|
qm create $VMCIID --name debian$OSV-cloudinit --memory 512 --net0 virtio,bridge=vmbr0 --ostype l26 --agent 1 --protection 0 --tags template
|
|
qm importdisk $VMCIID $FILE local --format qcow2
|
|
qm set $VMCIID --scsihw virtio-scsi-single --scsi0 local:$VMCIID/vm-$VMCIID-disk-0.qcow2
|
|
qm set $VMCIID --boot c --bootdisk scsi0
|
|
qm set $VMCIID --ide0 local:cloudinit
|
|
qm set $VMCIID --serial0 socket --vga serial0
|
|
qm set $VMCIID --description "Created by: cloud$OSV.sh<br>debian $OSV cloud-init template:<br>$FILETS<br>Deployed: $timestamp"
|
|
qm template $VMCIID
|