FOUR-TB is a storage, by default - Local. qm stop 1000 # Stop the VM if it's running qm destroy 1000 # Delete the VM
qm create 1000 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --agent 1
Debian cloud.debian.org пример: *genericcloud-amd64.qcow2
Go to cloud-images.ubuntu.com and download the latest image. For example:
cd /mnt/4tb/template/iso wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# Copy and rename the image (change the extension) cp jammy-server-cloudimg-amd64.img jammy-server-cloudimg-amd64.qcow2 # Resize the disk (not necessary) qemu-img resize jammy-server-cloudimg-amd64.qcow2 3G (2-3gb is minimal for jammy) Can change in web panel pve resize
# Import the disk into storage (e.g., FOUR-TB) qm disk import 1000 jammy-server-cloudimg-amd64.qcow2 FOUR-TB # Attach the disk as ide0 with discard enabled qm set 1000 --ide0 FOUR-TB:1000/vm-1000-disk-0.raw,discard=on
# Assign cloud-init to ide1 (ide0 is already in use) qm set 1000 --ide1 FOUR-TB:cloudinit
# Set the VM to boot from the main disk qm set 1000 --boot order=ide0
# Stop the VM qm stop 1000 # Convert to a template qm template 1000 #if necessary, we change the disk size qm resize 1000 ide0 +2G # Create a full clone qm clone 1000 1001 --full
Many Cloud-Init images require the use of Serial Consoles. You can configure this: QM SET 1000 —serial0 Socket --vga Serial0
If the Cloud-Init disk has already been used and you no longer need it (you can delete so that you do not occupy a slot).