Telmate / terraform-provider-proxmox

Terraform provider plugin for proxmox
MIT License
2.21k stars 533 forks source link

Pools get created but not imported into state #1130

Closed vetlekise closed 1 month ago

vetlekise commented 1 month ago

Versions

Provider version: 3.0.1-rc4 Terraform version: 4.6.0

Error

Whenever I create a pool using the below block:

resource "proxmox_pool" "vm-pool" {
  poolid  = "vm-pool"
  comment = "Pool for virtual machines"
}

I get an error saying:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to proxmox_pool.vm-pool, provider
│ "provider[\"registry.terraform.io/telmate/proxmox\"]" produced an
│ unexpected new value: Root object was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

If I try to re-run the failed jobs it tells me the resource already exists:

 Error: 500 create pool failed: pool 'vm-pool' already exists
│ 
│   with proxmox_pool.vm-pool,
│   on pools.tf line 3, in resource "proxmox_pool" "vm-pool":
│    3: resource "proxmox_pool" "vm-pool" {
│ 
╵
Releasing state lock. This may take a few moments...
vetlekise commented 1 month ago

Does anyone know the ID used when importing the pools into state? I tried importing the pool manually with:

terraform import proxmox_pool.vm-pool vm-pool

But this give med following error:

│ Error: Cannot import non-existent remote object
│ 
│ While attempting to import an existing object to "proxmox_pool.vm-pool",
│ the provider detected that no object exists with the given id. Only
│ pre-existing objects can be imported; check that the id is correct and that
│ it is associated with the provider's configured region or endpoint, or use
│ "terraform apply" to create a new remote object for this resource.
vetlekise commented 1 month ago

Proxmox version was old 8.0.3. It got fixed after updating to 8.2.7.

TNAJanssen commented 1 week ago

This is still an issue, i have this issue on 8.2.7