Files
Sankofa/docs/status/vms/VM_TEMPLATE_VZTMPL_ISSUE.md
defiQUG a8106e24ee Remove obsolete audit and deployment documentation files
- Deleted outdated files related to repository audit and deployment status, including AUDIT_COMPLETE.md, AUDIT_FIXES_APPLIED.md, FINAL_DEPLOYMENT_STATUS.md, and others.
- Cleaned up documentation to streamline the repository and improve clarity for future maintenance.
- Updated README and other relevant documentation to reflect the removal of these files.
2025-12-12 19:42:31 -08:00

2.7 KiB

VM Template vztmpl Format Issue

Date: 2025-12-11
Issue: vztmpl templates cannot be used for QEMU VMs


Problem

The provider code attempts to use vztmpl templates (LXC container templates) for QEMU VMs, which is incorrect.

Template Format: local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst

Provider Behavior (Line 297 in client.go):

diskConfig = fmt.Sprintf("%s,format=qcow2", imageVolid)
// Results in: local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst,format=qcow2

Problem: Proxmox cannot use a vztmpl template as a QEMU VM disk. This format is for LXC containers only.


Root Cause

  1. vztmpl templates are for LXC containers

  2. QEMU VMs need either:

    • Cloud images (.img, .qcow2) - requires importdisk
    • QEMU templates (VM templates converted from VMs)
  3. The provider code doesn't distinguish between container templates and VM templates


Solutions

Option 1: Use Cloud Image (Current)

image: "local:iso/ubuntu-22.04-cloud.img"

Pros:

  • Works with current provider code
  • Cloud-init ready
  • Available in storage

Cons:

  • ⚠️ Requires importdisk API (can cause locks)
  • ⚠️ Slower VM creation
  • ⚠️ Needs provider code fix for proper task monitoring
  1. Create VM from cloud image
  2. Configure and customize
  3. Convert to template: qm template <vmid>
  4. Use template ID in image field

Pros:

  • Fast cloning
  • No import needed
  • Pre-configured

Cons:

  • Requires manual setup
  • Need to maintain templates

Option 3: Fix Provider Code (Best Long-term)

  • Detect vztmpl format and reject for VMs
  • Add proper task monitoring for importdisk
  • Wait for import completion before config updates
  • Better error handling

Current Status

VM 100: Reverted to use cloud image format

  • image: "local:iso/ubuntu-22.04-cloud.img"
  • Will use importdisk API
  • May experience lock issues until provider code is fixed

All Other Templates: Still using vztmpl format

  • ⚠️ Will fail when deployed
  • Need to be updated to cloud image format or QEMU template

Next Steps

  1. Immediate: Update all templates to use cloud image format
  2. Short-term: Monitor VM 100 creation with cloud image
  3. Long-term: Fix provider code for proper template handling
  4. Long-term: Create QEMU templates for faster deployment

Template Update Required

All 29 templates need to be updated from:

image: "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"

To:

image: "local:iso/ubuntu-22.04-cloud.img"

Or use QEMU template ID if available.


Status: ⚠️ ISSUE IDENTIFIED - TEMPLATES NEED UPDATE