You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Proxmox API complains about using qcow2 with Thin-LVM storage after trying to create VM with 2 disks...
Or rather I should say: Provider does something magical and NOT COMPLAIN when creating first boot disk with wrong qcow2.
To Reproduce
This might be kinda hard to explain, as we're using our own module that uses dynamic function, but as a result we're doing this:
Create a resource proxmox_virtual_environment_vm with 1 disk on datastore_id that uses Thin-LVM.
Run terraform apply.
Runs perfectly fine, even thought IT SHOULDN'T because you can't use default qcow2 as file format for Thin-LVM. And disk is actually created as RAW. What's weirder, is that second terraform apply doesn't show any difference even though provider tries to use qcow2 and Proxmox has set raw anyway.
Run terraform destroy (IMPORTANT! as there's no errors when running consecutive applies!).
Add second disk to proxmox_virtual_environment_vm definition.
Run terraform apply again to create everything from scratch with 2 disks (one boot, and second for data).
See (perfectly valid) error this time:
╷
│ Error: error updating VM: received an HTTP 500 response - Reason: unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87.
│
│ with proxmox_virtual_environment_vm.vms["qdrant-3"],
│ on proxmox.tf line 18, in resource "proxmox_virtual_environment_vm" "vms":
│ 18: resource "proxmox_virtual_environment_vm" "vms" {
│
╵
Manually specifying file_format = "raw" of course works, the issue is not with wrong file_format interpretation, it's about incorrect behaviour with first disk.
Expected behavior
Provider should fail at the beginning when boot disk was trying to create with wrong setting.
@bpg great question! I totally forgot about this important detail!
We're cloning VM Template which already contains disk image with Debian and it's correctly resized later to desired size specified in first disk. VM Template disk is on Thin LVM pool.
And no warning/error about wrong format for that disk.
Describe the bug
Proxmox API complains about using
qcow2
with Thin-LVM storage after trying to create VM with 2 disks...Or rather I should say: Provider does something magical and NOT COMPLAIN when creating first boot disk with wrong
qcow2
.To Reproduce
This might be kinda hard to explain, as we're using our own module that uses
dynamic
function, but as a result we're doing this:proxmox_virtual_environment_vm
with 1 disk ondatastore_id
that uses Thin-LVM.terraform apply
.qcow2
as file format for Thin-LVM. And disk is actually created as RAW. What's weirder, is that secondterraform apply
doesn't show any difference even though provider tries to useqcow2
and Proxmox has setraw
anyway.terraform destroy
(IMPORTANT! as there's no errors when running consecutive applies!).proxmox_virtual_environment_vm
definition.terraform apply
again to create everything from scratch with 2 disks (one boot, and second for data).Manually specifying
file_format = "raw"
of course works, the issue is not with wrongfile_format
interpretation, it's about incorrect behaviour with first disk.Expected behavior
Provider should fail at the beginning when boot disk was trying to create with wrong setting.
Additional context
Proxmox version: 8.1.3
terraform version
:OS (where you run Terraform/OpenTofu from): macOS Sonoma 14.5 / HomeBrew
The text was updated successfully, but these errors were encountered: