You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a vsphere_virtual_machine resource who's windows_sysprep_text relies on another resource which has not yet been created, and the customization block fails the validation step with the following message:
"one of windows_options or windows_sysprep_text must exist in VM customization options for Windows operating systems"
Looking at the code, it appears that the validation step does not accept computed values for the windows_sysprep_text field:
The issue appears to originate from relying on the value from resourceDiff.Get() which throws away the information on whether the value is known or not at validation time, and could potentially be fixed by evaluating resourceDiff.NewValueKnown() in addition to checking for the empty string on line 488.
I am trying to create a
vsphere_virtual_machine
resource who'swindows_sysprep_text
relies on another resource which has not yet been created, and the customization block fails the validation step with the following message:Looking at the code, it appears that the validation step does not accept computed values for the
windows_sysprep_text
field:https://github.com/terraform-providers/terraform-provider-vsphere/blob/534931a5deb3be12c7217b6794781299fdce28cb/vsphere/internal/vmworkflow/virtual_machine_customize_subresource.go#L484-L496
The issue appears to originate from relying on the value from
resourceDiff.Get()
which throws away the information on whether the value is known or not at validation time, and could potentially be fixed by evaluatingresourceDiff.NewValueKnown()
in addition to checking for the empty string on line 488.Terraform Version
vSphere Provider Version
1.11.0
Affected Resource(s)
Please list the resources as a list, for example:
vsphere_virtual_machine
Terraform Configuration Files
Expected Behavior
Creating a virtual machine which uses a computed value for
windows_sysprep_text
passes validation.Actual Behavior
Creating a virtual machine which uses a computed value for
windows_sysprep_text
fails the validation check on the following line -https://github.com/terraform-providers/terraform-provider-vsphere/blob/534931a5deb3be12c7217b6794781299fdce28cb/vsphere/internal/vmworkflow/virtual_machine_customize_subresource.go#L493
Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: