Skip to content

Terraform provider crashes when using guest_customization_sysprep_custom_key_values #441

@d4vydm

Description

@d4vydm

Nutanix Cluster Information

Nutanix cluster: fraser-6.1-stable
Nutanix Prism central: 6.1

Terraform Version

Terraform v1.1.9
on darwin_arm64

provider registry.terraform.io/nutanix/nutanix v1.4.1

Affected Resource(s)

/

Terraform Configuration Files

This part of the TF config file is relevant:

...
resource "nutanix_virtual_machine" "vm" {
    name                 = "${var.machine["vm_name"]}"
    num_vcpus_per_socket = var.machine["vm_num_vcpus_per_socket"]
    num_sockets          = var.machine["vm_cpu"]
    memory_size_mib      = var.machine["vm_ram_mb"]
    cluster_uuid         = var.nutanix_cluster.id
    
    guest_customization_sysprep = {
      install_type = "PREPARED"
      unattend_xml = base64encode(file("${path.module}/files/unattend.xml"))
    }
    guest_customization_sysprep_custom_key_values = {
      vm_hostname = "TEST123"
    }
...

Debug Output

/

Panic Output

│ Error: Plugin did not respond

...

Stack trace from the terraform-provider-nutanix_v1.4.1 plugin:

panic: interface conversion: interface {} is map[string]interface {}, not map[string]string

goroutine 66 [running]:
github.com/terraform-providers/terraform-provider-nutanix/nutanix.getVMResources(0x14000124600, 0x140002c8000)
        github.com/terraform-providers/terraform-provider-nutanix/nutanix/resource_nutanix_virtual_machine.go:1565 +0x1740
github.com/terraform-providers/terraform-provider-nutanix/nutanix.resourceNutanixVirtualMachineCreate({0x100e0ff88, 0x1400092ab40}, 0x14000124600, {0x100cba460, 0x140003f28a0})
        github.com/terraform-providers/terraform-provider-nutanix/nutanix/resource_nutanix_virtual_machine.go:670 +0x4a8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x14000223340, {0x100e0ff18, 0x140005989c0}, 0x14000124600, {0x100cba460, 0x140003f28a0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:341 +0x118
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14000223340, {0x100e0ff18, 0x140005989c0}, 0x140007c0340, 0x14000302600, {0x100cba460, 0x140003f28a0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:467 +0x8d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140000b2018, {0x100e0ff18, 0x140005989c0}, 0x1400091ab90)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:977 +0xe38
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x14000592800, {0x100e0ffc0, 0x140005dcc30}, 0x140008084d0)
        github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/tf5server/server.go:603 +0x338
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x100dc5700, 0x14000592800}, {0x100e0ffc0, 0x140005dcc30}, 0x140006c4600, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001bce00, {0x100e1c590, 0x14000414300}, 0x140007dc200, 0x140003ed080, 0x10130ff80, 0x0)
        google.golang.org/grpc@v1.32.0/server.go:1194 +0xc38
google.golang.org/grpc.(*Server).handleStream(0x140001bce00, {0x100e1c590, 0x14000414300}, 0x140007dc200, 0x0)
        google.golang.org/grpc@v1.32.0/server.go:1517 +0xa34
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x140000a0d60, 0x140001bce00, {0x100e1c590, 0x14000414300}, 0x140007dc200)
        google.golang.org/grpc@v1.32.0/server.go:859 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.32.0/server.go:857 +0x1f0

Error: The terraform-provider-nutanix_v1.4.1 plugin crashed!

Expected Behavior

/

Actual Behavior

/

Steps to Reproduce

  1. terraform apply

References

/

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions