Membuat Template VM Debian – Proxmox Cloud Init

Install tool tambahan (Optional)

sudo apt update -y && sudo apt install libguestfs-tools -y

Download image

wget https://cdimage.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2

Buat menjadi file bak

mv debian-12-generic-amd64.qcow2 debian-12-generic-amd64.qcow2.bak

Copy file

cp debian-12-generic-amd64.qcow2.bak debian-12-generic-amd64.qcow2

Resize disk

qemu-img resize debian-12-generic-amd64.qcow2 5G

Buat VM

qm create 701 --name "debian12-cloudinit"\
    --memory 1024 \
    --cores 1 \
    --agent 1 \
    --vga serial0 --serial0 socket  \
    --net0 virtio,bridge=vmbr0

Import disk

qm importdisk 701 debian-12-generic-amd64.qcow2 lvm-harddisk

Plug disk ke VM

qm set 701 --scsihw virtio-scsi-pci --scsi0 lvm-harddisk:vm-701-disk-0,discard=on,ssd=1

Sesuaikan boot order

qm set 701 --boot order=scsi0

Pasangkan cloud init ke VM

qm set 701 --ide2 lvm-harddisk:cloudinit

Buat menjadi Template

Sesuaikan user password pada cloud init

Jalankan VM