Problem
When you perform a Terraform operation on a vSphere cluster that has vSAN disks attached, Terraform crashes with a panic: interface conversion error.
The error message from the terraform-provider-vsphere_v2.1.0_x5 plugin is similar to the following output.
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 are using the Terraform vSphere provider version 2.1.0.
Cause
In version 2.1.0 of the vSphere provider, the type for the vsan_disk_group attribute was changed from typelist to typeset. This was an unintended breaking change that causes a panic in situations where type assertions for the attribute were not updated to handle TypeSet (e.g., .(*schema.Set).List() vs .([]interface{})).
Solution
To resolve this issue, you must upgrade the Terraform vSphere provider to a later version. The breaking change was reverted in version 2.1.1 of the provider.
Update your provider version constraint in your Terraform configuration and run terraform init -upgrade to apply the fix.
The feature update that originally caused this issue is planned for a future major release (v3.0.0) of the provider.