Problem
When you're performing a terraform operation on your vSphere cluster that has vSan disks attached, and Terraform crashes with an error similar to this:
Stack trace from the terraform-provider-vsphere_v2.1.0_x5 plugin: panic: interface conversion: interface {} is *schema.Set, not []interface {} goroutine 81 [running]: github.com/hashicorp/terraform-provider-vsphere/vsphere.updateVsanDisks(0xc000547300, 0xc000354d40, 0x14542e0, 0xc000053440, 0x0, 0x0)
.
.
.
Error: The terraform-provider-vsphere_v2.1.0_x5 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely helpful
if you could report the crash with the plugin's maintainers so that it can be fixed.
The output above should help diagnose the issue.
Prerequisites
- You're using the Terraform vSphere provider version 2.1.0.
Cause
Updating the type of vsan_disk_group
in the provider code from typelist
to typeset
in version 2.1.0 was an unintended breaking change that caused a crashes in situations where type assertions around the attribute need to be tweaked with TypeSet
(i.e .(*schema.Set).List()
vs .([]interface{})
.
Solution
The change was reverted in version 2.1.1 and it is advised that if you're on 2.1.0 - to update to 2.1.1 as soon as possible to rectify the situation. The feature update that caused the breaking change will be addressed in a later release (v3.0.0) of the provider.