terraform-provider-proxmox
terraform-provider-proxmox copied to clipboard
Allow to change resource pool for VM / container without re-creating the resource
Describe the bug When trying to change/add pool id to existing container it forces replacement
To Reproduce Steps to reproduce the behavior:
- Create a proxmox_virtual_environment_container
- Update pool_id value
- See error "proxmox_virtual_environment_container.alpine_container must be replaced"
Please also provide a minimal Terraform configuration that reproduces the issue. registry.terraform.io/bpg/proxmox { version = "0.37.0" constraints = "0.37.0" } "terraform_version": "1.6.3",
Expected behavior Pool id modifications shouldn't force replacement
Thanks for report, @Anfer410!
The PVE does not allow to change the pool ID on VM / container level after creation. I.e. when you create a container you can assign it to a pool. But in order to change the assignment, or to assign to a pool after creation, you have to go through the pool management on datacenter level, not the VM / container on a PVE node:
The API is structured in the same way, so provider can specify a pool at creation time, but can't update it when the VM / container resource is updated. Instead, we can use proxmox_virtual_environment_pool
resource for pool management. However, the update command for this resource is not fully implemented -- it allows only to update a comment, but not members :(
Hope this makes sense. I'm going to re-classify the ticket as "enhancement" then.