I’m new to Terraform. I’m not sure if this is the right place to post this.
I’m trying to create a VM from an Ubuntu 25.04 cloud image, using the telmate/proxmox provider. ‘terraform init’ install version 2.9.14 of the provider. When I run apply, it creates the VM, but then crashes with the following error:
Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:
panic: interface conversion: interface {} is string, not float64
goroutine 87 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc00035c718, 0xc9d509?)
github.com/Telmate/proxmox-api-go@v0.0.0-20230319185744-e7cde7198cdf/proxmox/config_qemu.go:584 +0x4605
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc000314b00, {0xb66f60?, 0xc0004a9680})
github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x2c4d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xdd7840?, {0xdd7840?, 0xc00060b350?}, 0xd?, {0xb66f60?, 0xc0004a9680?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000192ee0, {0xdd7840, 0xc00060b350}, 0xc0006f0410, 0xc000314200, {0xb66f60, 0xc0004a9680})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000429ef0, {0xdd7840?, 0xc00060b230?}, 0xc000434d70)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002c03c0, {0xdd7840?, 0xc00060a840?}, 0xc0001bd650)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xc6bc20?, 0xc0002c03c0}, {0xdd7840, 0xc00060a840}, 0xc0001bd5e0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00025a1e0, {0xddb420, 0xc000482340}, 0xc0006e47e0, 0xc000437740, 0x128f7a0, 0x0)
google.golang.org/grpc@v1.53.0/server.go:1336 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00025a1e0, {0xddb420, 0xc000482340}, 0xc0006e47e0, 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!
The VM boots OK. This is my config file. Note, I added the version number because I was later trying a development version of the provider.
terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "2.9.14"
}
}
}
provider "proxmox" {
pm_api_url = "https://tanuki:8006/api2/json"
pm_api_token_id = "terraform@pam!terraform"
pm_api_token_secret = "xxxxxx"
pm_tls_insecure = true
}
resource "proxmox_vm_qemu" "terra-test" {
name = "terra-test"
target_node = "tanuki"
clone = "ubuntu-2504-template"
full_clone = true
#storage = "local-lvm"
cores = 2
memory = 2048
disk {
size = "32G"
type = "scsi"
storage = "local-lvm"
discard = "on"
}
network {
model = "virtio"
bridge = "vmbr2"
firewall= false
link_down= false
}
}
I tried 3.0.1-rc9 of the provider. ‘apply’ completes, but the console won’t connect. I had to modify the config to get it to work:
terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "3.0.1-rc9"
}
}
}
provider "proxmox" {
pm_api_url = "https://tanuki:8006/api2/json"
pm_api_token_id = "terraform@pam!terraform"
pm_api_token_secret = "xxxxxx"
pm_tls_insecure = true
}
resource "proxmox_vm_qemu" "terra-test" {
name = "terra-test"
target_node = "tanuki"
clone = "ubuntu-2504-template"
full_clone = true
cpu {
cores = 2
}
memory = 2048
os_type = "cloud-init"
disks {
ide{
ide0{
cloudinit{
storage="local-lvm"
}
}
}
scsi {
scsi0 {
disk {
size = "32G"
storage = "local-lvm"
discard = "true"
}
}
}
}
network {
model = "virtio"
bridge = "vmbr2"
firewall= true
link_down= false
id = 0
}
ipconfig0 = "ip=dhcp"
}
Any idea what I’m doing wrong?