tofu(proxmox): download base image as import content-type for disk import_from

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
jakman85andClaude Opus 4.8 committed 2026-08-25 10:59:01 -05:00
1 parent a2392a4a43
commit fca8d8f800
2 files changed
+10 -7

No files matched your search

+6 -3
View File
@@ -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
+4 -4
View File
@@ -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 ----------------------------------------------------