Proxmox Ollama Template VM 102 runbook.
Interactive operational guide for preparing, verifying, converting, and testing a reusable Ubuntu/Ollama Proxmox template. Commands are copy-ready and sensitive site values are replaced with placeholders for public-safe documentation.
Public-safe note
Replace placeholders before running commands.
This guide intentionally uses PROXMOX_HOST_OR_IP, STALE_STORAGE_ID, VMID, and PASTE_PUBLIC_KEY_HERE placeholders. Do not publish private IPs, SSH private keys, tokens, passwords, or credentials.
Step 1
Overview
Document VM 102 as a reusable Ubuntu/Ollama template with Cloud-Init, QEMU Guest Agent, safe SSH handling, and repeatable clone testing.
Step 2
Safety correction
The prior failure pattern was deleting SSH host keys while still configuring over SSH. For template identity, use Cloud-Init and clone-time regeneration instead.
sudo rm -f /etc/ssh/ssh_host_*sudo cloud-init clean --logs
sudo truncate -s 0 /etc/machine-id
sudo rm -f /var/lib/dbus/machine-id
sudo ln -sf /etc/machine-id /var/lib/dbus/machine-idStep 3
Storage verification
Verify active storage, remove stale storage entries only after confirming they point to missing or incorrect mounts.
lsblk -o NAME,SIZE,MODEL,SERIAL,FSTYPE,LABEL,MOUNTPOINT
df -h
pvesm status
cat /etc/pve/storage.cfgpvesm remove STALE_STORAGE_IDStep 4
Access method
Use a dedicated key from the Hermes/Godzilla server to administer Proxmox. Public docs use placeholders and do not publish private keys or site IPs.
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t ed25519 -f ~/.ssh/godzilla_proxmox_ed25519 -N '' -C 'godzilla-hermes-proxmox-access'
cat ~/.ssh/godzilla_proxmox_ed25519.pubmkdir -p /root/.ssh
chmod 700 /root/.ssh
cat >> /root/.ssh/authorized_keys <<'EOF'
PASTE_PUBLIC_KEY_HERE
EOF
chmod 600 /root/.ssh/authorized_keysssh -i ~/.ssh/godzilla_proxmox_ed25519 -o BatchMode=yes -o StrictHostKeyChecking=accept-new root@PROXMOX_HOST_OR_IPStep 5
Inspect VM
Before changing anything, confirm Proxmox version, VM configuration, VM status, storage status, ISO availability, and guest-agent status.
hostname
pveversion
qm config 102qm status 102
qm list
pvesm status
ls -lah /mnt/pve/backup-iso-sdb/template/isoqm agent 102 ping
qm agent 102 network-get-interfaces
qm status 102 --verboseStep 6
Template prep
Set CPU type to host for better Ollama CPU feature exposure. Add a visible description documenting Cloud-Init and SSH host key guardrails.
qm set 102 --cpu hostqm set 102 --description "Ollama Ubuntu template base. QEMU guest agent enabled. CPU host. Use cloud-init; do not manually delete SSH host keys during prep."Step 7
Cloud-Init
Cloud-Init should provide clone identity and network/user initialization instead of manual SSH host key deletion.
qm set 102 --ide0 local-lvm:cloudinit
qm set 102 --ciuser luis --ipconfig0 ip=dhcpqm config 102 | grep -E "ide0|ciuser|ipconfig0"Step 8
Guest packages
Inside the Ubuntu guest, install and enable qemu-guest-agent, cloud-init, and OpenSSH before converting to a template.
sudo apt update
sudo apt install -y cloud-init qemu-guest-agent openssh-server
sudo systemctl enable --now qemu-guest-agent
sudo systemctl enable --now sshsystemctl is-active qemu-guest-agent
systemctl is-active sshqm agent VMID ping
qm agent VMID network-get-interfacesStep 9
Guest cleanup
Run only after package installation and SSH verification are complete. Do not delete SSH host keys manually during active remote setup.
sudo cloud-init clean --logs
sudo truncate -s 0 /etc/machine-id
sudo rm -f /var/lib/dbus/machine-id
sudo ln -sf /etc/machine-id /var/lib/dbus/machine-id
sudo rm -f /var/lib/dhcp/*
sudo rm -f /var/lib/systemd/network/*.leaseStep 10
Shutdown
After Ubuntu install and setup are confirmed complete, shut down the VM from Proxmox before removing ISO and converting.
qm shutdown 102 --timeout 180 || qm stop 102
qm status 102Step 11
Finalize template
Remove installer ISO so clones do not boot into the installer. Boot from installed disk only, refresh Cloud-Init, then convert to template.
qm set 102 --delete ide2
qm set 102 --boot order=scsi0
qm cloudinit update 102 || true
qm template 102qm config 102
qm listStep 12
Replication checklist
Use these settings when building the next reusable Ollama template VM.
Name: ollama-template
VMID: choose unused ID, example 9000 or 102
OS: Ubuntu Server ISO
Machine: q35
BIOS: OVMF / UEFI
SCSI Controller: VirtIO SCSI single
Disk: local-lvm, 32G minimum
CPU Type: host
Cores: 8 preferred
RAM: 16GB minimum; 32GB+ preferred for production
Network: VirtIO, bridge vmbr0
QEMU Guest Agent: EnabledStep 13
Clone test
A template is not operationally proven until a clone boots, receives networking, and responds to QEMU guest-agent calls.
qm clone 102 103 --name ollama-test --full true --storage local-lvm
qm start 103qm agent 103 ping
qm agent 103 network-get-interfacessudo apt update
sudo apt install -y qemu-guest-agent cloud-init openssh-server
sudo systemctl enable --now qemu-guest-agent
sudo systemctl enable --now sshStep 14
Production notes
The base template disk is intentionally small. Production clones should be expanded or given a dedicated model disk, and GPU passthrough/NVIDIA drivers should be applied to the clone, not the base template.
qm config OLLAMA_CLONE_VMID
qm resize OLLAMA_CLONE_VMID scsi0 +200GInstall NVIDIA drivers inside the Ollama VM clone, not on the Proxmox host, when using PCI passthrough.Step 15
Quick command reference
Short command set for inspection, Cloud-Init, conversion, clone testing, and guest-agent validation.
qm config VMID
qm status VMID
qm listqm set VMID --cpu host
qm set VMID --ide0 local-lvm:cloudinit
qm set VMID --ciuser luis --ipconfig0 ip=dhcp
qm cloudinit update VMIDqm set VMID --delete ide2
qm set VMID --boot order=scsi0
qm shutdown VMID --timeout 180 || qm stop VMID
qm template VMIDqm clone VMID NEWID --name ollama-test --full true --storage local-lvm
qm start NEWID
qm agent NEWID ping
qm agent NEWID network-get-interfaces