Proxmox template • Cloud-Init • Ollama VM base

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.

Execution Progress0 of 0 complete
15Sections
102Template VM
CloudInit based

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.

Security

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.

Verified baseline

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.

High risk
Do not run during active SSH setupNO COPY
sudo rm -f /etc/ssh/ssh_host_*
Safer cleanup pattern
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

Step 3

Storage verification

Verify active storage, remove stale storage entries only after confirming they point to missing or incorrect mounts.

Verified before conversion
Inspect storage and mounted disks
lsblk -o NAME,SIZE,MODEL,SERIAL,FSTYPE,LABEL,MOUNTPOINT
df -h
pvesm status
cat /etc/pve/storage.cfg
Remove stale storage entry if verified stale
pvesm remove STALE_STORAGE_ID

Step 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.

Credential-safe
Generate a dedicated key locally
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.pub
Add public key on Proxmox
mkdir -p /root/.ssh
chmod 700 /root/.ssh
cat >> /root/.ssh/authorized_keys <<'EOF'
PASTE_PUBLIC_KEY_HERE
EOF
chmod 600 /root/.ssh/authorized_keys
Connect to Proxmox with placeholder host
ssh -i ~/.ssh/godzilla_proxmox_ed25519 -o BatchMode=yes -o StrictHostKeyChecking=accept-new root@PROXMOX_HOST_OR_IP

Step 5

Inspect VM

Before changing anything, confirm Proxmox version, VM configuration, VM status, storage status, ISO availability, and guest-agent status.

Proxmox host
Verify host and VM configuration
hostname
pveversion
qm config 102
Verify VM state, storage, and ISO files
qm status 102
qm list
pvesm status
ls -lah /mnt/pve/backup-iso-sdb/template/iso
Check QEMU Guest Agent from Proxmox
qm agent 102 ping
qm agent 102 network-get-interfaces
qm status 102 --verbose

Step 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.

Action
Set CPU type to host
qm set 102 --cpu host
Add operational description
qm 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.

Action
Add Cloud-Init drive and defaults
qm set 102 --ide0 local-lvm:cloudinit
qm set 102 --ciuser luis --ipconfig0 ip=dhcp
Verify Cloud-Init config
qm 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.

Inside VM
Install required guest packages
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 ssh
Verify inside guest
systemctl is-active qemu-guest-agent
systemctl is-active ssh
Verify from Proxmox host
qm agent VMID ping
qm agent VMID network-get-interfaces

Step 9

Guest cleanup

Run only after package installation and SSH verification are complete. Do not delete SSH host keys manually during active remote setup.

Optional
Clean guest identity safely
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/*.lease

Step 10

Shutdown

After Ubuntu install and setup are confirmed complete, shut down the VM from Proxmox before removing ISO and converting.

Action
Shutdown from Proxmox
qm shutdown 102 --timeout 180 || qm stop 102
qm status 102

Step 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.

Action
Finalize VM 102 as template
qm set 102 --delete ide2
qm set 102 --boot order=scsi0
qm cloudinit update 102 || true
qm template 102
Verify final template config
qm config 102
qm list

Step 12

Replication checklist

Use these settings when building the next reusable Ollama template VM.

Reference
Recommended VM settings
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: Enabled

Step 13

Clone test

A template is not operationally proven until a clone boots, receives networking, and responds to QEMU guest-agent calls.

Validation
Create and start a test clone
qm clone 102 103 --name ollama-test --full true --storage local-lvm
qm start 103
Verify clone guest agent and network
qm agent 103 ping
qm agent 103 network-get-interfaces
Repair guest agent inside clone if needed
sudo apt update
sudo apt install -y qemu-guest-agent cloud-init openssh-server
sudo systemctl enable --now qemu-guest-agent
sudo systemctl enable --now ssh

Step 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.

Operational notes
Inspect and resize clone disk as needed
qm config OLLAMA_CLONE_VMID
qm resize OLLAMA_CLONE_VMID scsi0 +200G
GPU driver rule
Install 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.

Reference
Inspect VM
qm config VMID
qm status VMID
qm list
Set CPU and Cloud-Init
qm set VMID --cpu host
qm set VMID --ide0 local-lvm:cloudinit
qm set VMID --ciuser luis --ipconfig0 ip=dhcp
qm cloudinit update VMID
Remove ISO and convert
qm set VMID --delete ide2
qm set VMID --boot order=scsi0
qm shutdown VMID --timeout 180 || qm stop VMID
qm template VMID
Clone and test
qm clone VMID NEWID --name ollama-test --full true --storage local-lvm
qm start NEWID
qm agent NEWID ping
qm agent NEWID network-get-interfaces