JimsGarage/Kubernetes/Cloud-Init
Muse Mulatu a3780c6661 feat: parameterize VMID and storage fields
- Add command to turn VM into a template.
- Add command to resize disk size.
- disable memory ballooning
2023-12-03 09:41:04 -07:00
..
readme.md feat: parameterize VMID and storage fields 2023-12-03 09:41:04 -07:00

readme.md

  1. Download the ISO using the GUI (tested on https://cloud-images.ubuntu.com/lunar/current/lunar-server-cloudimg-amd64-disk-kvm.img)
  2. Create the VM via CLI
VMID=<TEMPLATE ID HERE>
STORAGE=<YOUR STORAGE HERE>

qm create $VMID --memory 2048 --balloon 0 --core 2 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
cd /var/lib/vz/template/iso/
qm importdisk 5000 lunar-server-cloudimg-amd64-disk-kvm.img $STORAGE
qm set $VMID --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-$VMID-disk-0,discard=on,ssd=1
qm set $VMID --ide2 ${STORAGE}:cloudinit
qm set $VMID --boot c --bootdisk scsi0
qm set $VMID --serial0 socket --vga serial0
  1. Expand the VM disk size to a suitable size (suggested 10 GB)
qm resize $VMID scsi0 10G
  1. Head over to Proxmox UI > VMID > Cloud-Init section and set username, password, ssh keys and ip address configuration as desired.
  2. Create the Cloud-Init template
qm template $VMID
  1. Deploy new VMs by cloning the template (full clone)