From fca8d8f8005baa77d3ad287f63009035524f956d Mon Sep 17 00:00:00 2001 From: Keith Jackson Date: Tue, 25 Aug 2026 10:59:01 -0500 Subject: [PATCH] tofu(proxmox): download base image as import content-type for disk import_from Co-Authored-By: Claude Opus 4.8 --- infra/tofu/main.tf | 9 ++++++--- infra/tofu/variables.tf | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/infra/tofu/main.tf b/infra/tofu/main.tf index 9e324b3..db7d4a4 100644 --- a/infra/tofu/main.tf +++ b/infra/tofu/main.tf @@ -35,10 +35,13 @@ locals { } # --- base OS cloud image (downloaded once to `local`, imported per node) ----- -# content_type "iso" stores it on the ISO datastore; the .img file name lets -# Proxmox accept the qcow2 (it still reads it as qcow2 on disk import). +# content_type "import" (PVE 8.2+): the image must be on `import`-content storage to +# be usable as a VM disk `import_from` (uncompressed qcow2 only — ours qualifies). +# OPERATOR ACTION: enable the "Import" content type on var.image_datastore (Datacenter +# -> Storage -> local -> Content -> check "Import"), else the disk import fails with +# "wrong type 'iso' - needs to be 'images' or 'import'". resource "proxmox_virtual_environment_download_file" "debian_cloud_image" { - content_type = "iso" + content_type = "import" datastore_id = var.image_datastore node_name = var.proxmox_node url = var.image_source diff --git a/infra/tofu/variables.tf b/infra/tofu/variables.tf index d84a3b4..81c6b79 100644 --- a/infra/tofu/variables.tf +++ b/infra/tofu/variables.tf @@ -167,12 +167,12 @@ variable "image_source" { variable "image_file_name" { description = <<-EOT - File name the cloud image is stored as on image_datastore. Proxmox `iso`-content - storage only accepts *.iso / *.img names, so a qcow2 URL must be saved with a - .img extension (Proxmox still reads it as qcow2 on import). + File name the cloud image is stored as on image_datastore. With `import`-content + storage (PVE 8.2+) the native .qcow2 name is used directly — the old .img rename + was an `iso`-content workaround and is no longer needed. EOT type = string - default = "debian-12-genericcloud-amd64.img" + default = "debian-12-genericcloud-amd64.qcow2" } # --- cloud-init identity ----------------------------------------------------