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 unable to create multiple vcd_nsxt_edgegateway resources because of what appears to be some sort of global lock against concurrent writes.
Terraform Version
Terraform v1.9.5
on linux_amd64
+ provider registry.terraform.io/vmware/vcd v3.14.0
Affected Resource(s)
Please list the resources as a list, for example:
vcd_nsxt_edgegateway
Terraform Configuration Files
This is a minimal reproducible example that shows the issue. The subnet ranges may need to be adjusted according to the environment this code is tested on.
Ability to create multiple vcd_nsxt_edgegateway resources when either count or for_each are present.
Actual Behavior
By default, Terraform tries to create up to 10 resources in parallel so that means it will try to create all 5 (in my example) vcd_nsxt_edgegateway resources at the same time, failing with the following error:
Error: error creating NSX-T Edge Gateway: error creating Edge Gateway: error waiting completion of task (https://<REDACTED>/api/task/599a293e-e13c-4d2e-9413-5515e20a3a04): task did not complete successfully: [500:INTERNAL_SERVER_ERROR] - [ 22-2024-09-19-12-33-45-963--cfae3c5b-e02b-494c-9cc0-e1e669ed6401 ] Internal Server Error
- Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
- Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
with vcd_nsxt_edgegateway.this["10.20.252.0/24"],
on main.tf line 69, in resource "vcd_nsxt_edgegateway" "this":
69: resource "vcd_nsxt_edgegateway" "this" {
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
I can work around this by setting -parallelism=2 in terraform apply but that slows down the entire deployment just because of this one resource
References
Unfortunately, Terraform does not provide a way to control per-resource parallelism, as noted in hashicorp/terraform-plugin-sdk#67. According to that same issue, the provider should handle such cases, as noted by @apparentlymart.
The text was updated successfully, but these errors were encountered:
Hello,
I am unable to create multiple
vcd_nsxt_edgegateway
resources because of what appears to be some sort of global lock against concurrent writes.Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
vcd_nsxt_edgegateway
Terraform Configuration Files
This is a minimal reproducible example that shows the issue. The subnet ranges may need to be adjusted according to the environment this code is tested on.
Debug Output
Here's the Gist with both files: https://gist.github.com/brainplot/21d22e847a60eace8ce2ef74a1795677
Expected Behavior
Ability to create multiple
vcd_nsxt_edgegateway
resources when eithercount
orfor_each
are present.Actual Behavior
By default, Terraform tries to create up to 10 resources in parallel so that means it will try to create all 5 (in my example)
vcd_nsxt_edgegateway
resources at the same time, failing with the following error:Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
I can work around this by setting
-parallelism=2
interraform apply
but that slows down the entire deployment just because of this one resourceReferences
Unfortunately, Terraform does not provide a way to control per-resource parallelism, as noted in hashicorp/terraform-plugin-sdk#67. According to that same issue, the provider should handle such cases, as noted by @apparentlymart.
The text was updated successfully, but these errors were encountered: