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
Is your feature request related to a problem? Please describe.
Hello,
I'm currently working on implementing micro-segmentation using NSX-T with the Terraform provider. Given the size of our environment, I had to automate the rules creation process for the existing connections. This led me to already having thousands of rules, groups, and services while I still didn't put the majority of my VMs into NSX-T.
When running "terraform plan" and then "terraform plan -refresh=false", I can see that the great majority of the time is spent refreshing the state.
As I understand, this is because the provider is currently designed to make one request per policy, group, and service to refresh. Given that the vast majority of my policy, group, and service are defined in Terraform, I think it would be faster to simply list all of them at the start rather than making an individual request per resource.
Describe the solution you'd like
After having read this issue (hashicorp/terraform-plugin-sdk#7), I understand that request batching in Terraform is a complex problem.
Meanwhile, maybe we could implement the following strategy:
The users can opt-in to choose the resource types to refresh via batching; the behavior for resources without this option would remain unchanged.
In the planning phase, the first instance of the resource of a selected type we try to refresh acquires a lock (for its own type only).
We fetch all the instances of this type of resource using the listing API and put them in some in-memory cache.
Once the cache is filled, the lock is released, and the refreshed resource is then retrieved from the cache.
If this sounds like an acceptable solution to you, I can prepare a PR to implement this. Given that I'm unfamiliar with Terraform providers, any advice would be welcome.
Best Regards.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Hello,
I'm currently working on implementing micro-segmentation using NSX-T with the Terraform provider. Given the size of our environment, I had to automate the rules creation process for the existing connections. This led me to already having thousands of rules, groups, and services while I still didn't put the majority of my VMs into NSX-T.
When running "terraform plan" and then "terraform plan -refresh=false", I can see that the great majority of the time is spent refreshing the state.
As I understand, this is because the provider is currently designed to make one request per policy, group, and service to refresh. Given that the vast majority of my policy, group, and service are defined in Terraform, I think it would be faster to simply list all of them at the start rather than making an individual request per resource.
Describe the solution you'd like
After having read this issue (hashicorp/terraform-plugin-sdk#7), I understand that request batching in Terraform is a complex problem.
Meanwhile, maybe we could implement the following strategy:
If this sounds like an acceptable solution to you, I can prepare a PR to implement this. Given that I'm unfamiliar with Terraform providers, any advice would be welcome.
Best Regards.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: