Use cloud-init to configure cloud-images i.e. add SSH keys, set network settings, create users, install various packages
Cloud images are certified to run in public cloud services and as well Proxmox.
# SSH into Proxmox server
proxmox@proxmox:~#
# Download cloud image - Ubuntu Server 22.04(Jammy Jellyfish)
proxmox@proxmox:~# wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# Create new VM in Proxmox env
proxmox@proxmox:~# qm create 8000 --memory 4096 --core 2 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
# Import the downloaded disk to local-lvm storage
proxmox@proxmox:~# qm importdisk 8000 focal-server-cloudimg-amd64.img local-lvm
# Attach the new disk to the VM as scsi drive(Ubuntu Cloud-Init images require the virtio-scsi-pci controller for SCSI drives)
proxmox@proxmox:~# qm set 8000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-8000-disk-0
# Add/Config Cloud-init drive(create virtual cdrom and attach that)
proxmox@proxmox:~# qm set 8000 --ide2 local-lvm:cloudinit
# Configure to boot from cloud init drive
proxmox@proxmox:~# qm set 8000 --boot c --bootdisk scsi0
# Add serial console
proxmox@proxmox:~# qm set 8000 --serial0 socket --vga serial0
# Configure wanted parameters, see Cloud-Init Tab in proxmox for newly created VM
## set user, ssh keys(add your public ssh key), ip config(set dhcp), ...
# Right click and convert VM to Template
## or run qm template 8000
# Create new VM from template
## qm clone 8000 125 --name apa --full
I can extend size of cloud template in Proxmox GUI but how to do it in terminal?