allenporter / k8s-gitops

Flux/Gitops managed k8s cluster
32 stars 1 forks source link

Terraform provider broken with proxmox 8 #1428

Closed allenporter closed 6 months ago

allenporter commented 7 months ago

Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:

panic: interface conversion: interface {} is string, not float64

goroutine 10 [running]: github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc000133088, 0xc000133088?) github.com/Telmate/proxmox-api-go@v0.0.0-20230319185744-e7cde7198cdf/proxmox/config_qemu.go:584 +0x4605 github.com/Telmate/terraform-provider-proxmox/proxmox._resourceVmQemuRead(0xc000186100, {0xb66f60?, 0xc00042caa0}) github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1475 +0x457 github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuRead(0x0?, {0xb66f60?, 0xc00042caa0?}) github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1446 +0x25 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).read(0xdd7840?, {0xdd7840?, 0xc0001a26f0?}, 0xd?, {0xb66f60?, 0xc00042caa0?}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:712 +0x178 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).RefreshWithoutUpgrade(0xc000190ee0, {0xdd7840, 0xc0001a26f0}, 0xc00013c0d0, {0xb66f60, 0xc00042caa0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:1015 +0x585 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ReadResource(0xc00039ded8, {0xdd7840?, 0xc0001a2030?}, 0xc000419140) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:613 +0x4a5 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ReadResource(0xc0002b63c0, {0xdd7840?, 0xc00017fb30?}, 0xc000150180) github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4b1 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xc6bc20?, 0xc0002b63c0}, {0xdd7840, 0xc00017fb30}, 0xc0001c6000, 0x0) github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc00025a1e0, {0xddb420, 0xc000406340}, 0xc000799d40, 0xc0003ab7d0, 0x128f770, 0x0) google.golang.org/grpc@v1.53.0/server.go:1336 +0xd23 google.golang.org/grpc.(Server).handleStream(0xc00025a1e0, {0xddb420, 0xc000406340}, 0xc000799d40, 0x0) google.golang.org/grpc@v1.53.0/server.go:1704 +0xa2f google.golang.org/grpc.(Server).serveStreams.func1.2() google.golang.org/grpc@v1.53.0/server.go:965 +0x98 created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.53.0/server.go:963 +0x28a

Error: The terraform-provider-proxmox_v2.9.14 plugin crashed!

allenporter commented 7 months ago

Tracked in https://github.com/Telmate/terraform-provider-proxmox/issues/869

allenporter commented 7 months ago
$ terraform state replace-provider registry.terraform.io/telmate/proxmox registry.terraform.io/thegameprofi/proxmox
$ terraform init
allenporter commented 7 months ago

Terraform plan shows diffs, and errors applying:


│ Error: 403 Permission check failed (/sdn/zones/localnetwork/vmbr0, SDN.Use)
│ 
│   with module.vms.proxmox_vm_qemu.proxmox-vmm["trilogy"],
│   on .terraform/modules/vms/modules/vms/main.tf line 10, in resource "proxmox_vm_qemu" "proxmox-vmm":
│   10: resource "proxmox_vm_qemu" "proxmox-vmm" {
│ 

Fixed by adding the SDN permission

$ sudo pveum acl modify / -user terraform-prov@pve -role PVESDNUser
allenporter commented 7 months ago

Now the provider creates these diffs which seem like they'll break the disk:

Screenshot 2023-12-02 at 5 50 22 PM
allenporter commented 6 months ago

Abandoning proxmox & terraform provider.