-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The provider is slow when creating/destroying resources #929
Comments
@zhenrong-wang Hey Zhenrong! Thanks for raising the issue.
I guess that the refresh step is accountable for majority of that duration which is expected for large state files, because many API calls are required to be made over network to define the drift between the state file and the real infra. Could you please share the following:
Thanks! |
Thanks @kislerdm for your reply. Here is my project HPC-NOW. It depends on Terraform or openTofu to orchestrate cloud resources. 1. Versions:
2. How did I run: Instead of running terraform/openTofu command directly, the HPC-NOW project uses a "wrapper" to run in the hpcopr CLI. Therefore, I built 2 versions of hpcopr CLI, one uses openTofu, one uses Terraform. The provider keeps the same. I didn't wrap the Then, I run the command
3. The Results: a. hpcopr with openTofu: Creating a stack took 440 seconds. Destroying the stack took 380 seconds. b. hpcopr with Terraform Creating a stack took 161 seconds. Destroying the stack took 108 seconds 4. The DEBUG logs The logs of creating and destroying process are saved in 1 file. Sorry that I forgot to rename the first log when finished creating the stack, so the destroying process appended logs to the same file. hpcopr with openTofu hpcopr with Terraform 5. Summary: Creating a stack: openTofu - 440 seconds, Terraform - 168 seconds My local network remained unchanged during the 2 tests. From the DEBUG log of openTofu, it seems the provider doesn't work smoothly as expected. Looking forward to your support, thanks so much! Zhenrong |
Hey Zhenrong! Thanks for your prompt reply! Did I get it right, the provider version used with OpenTofu differs from the one used with terraform? If it's the case, could you please try to rerun your flow using identical provider versions, e.g. "terraform-provider-alicloud_1.203.0_linux_amd64.zip" in both cases? Thanks! |
Hi @kislerdm , The reason why I upgraded the provider version from 1.203.0 to the latest one (1.213.0) for openTofu, is because the same scenario (low speed and wait 100 secs to start) occurs in version 1.203.0. Sure I can rerun the test in minutes. But the situation will probably be the same. Please wait minutes. |
Hi @kislerdm
Thanks a lot! |
@zhenrong-wang Hey! Thanks a lot for sharing the details! Could you please share the logs for the verbosity level |
Sure, Let me modify the wrapper to generate a new group of logs. In order to compare, I will keep on using the provider version 1.203.0. Please wait minutes. |
Hi @kislerdm Just ran the test again. Creating the stack took 408 seconds; and destroying it took 405 seconds. Here are the logs. I generated 2 files. Please take a look. tofu-trace-creating-1.203.0-provider.log tofu-trace-destroying-1.203.0-provider.log Hope it helps. Thanks! |
Hi @zhenrong-wang! Thanks a lot for your collaboration! May I kindly ask to confirm if your setup was identical expect for binary your executed, i.e. tofu vs. terraform? In order words, did you ran Also, would it be possible to share the logs after running the For context, we have a couple of guesses and would like to verify them, but it'd take us extra time in order to reproduce the issue because we don't have experience with the hpcopr "wrapper" you used, neither do we have a lot of experience with ali cloud. Thank you very much for your support! 🙏🏻 |
Sure, I will run the terraform version and post the log here. One thing is for sure: only the binary (executable) changed. All other elements kept unchanged. In terms of the "wrapper", it is just another way the hpcopr CLI use to run terraform/tofu commands. Nothing different from running terraform/tofu directly. Please wait for my log with terraform. Thanks! |
terraform-trace-creating-1.203.0-provider.log @kislerdm Please check this out. For this time with terraform, destroying the stack took 240 seconds, a bit longer; while creating it took 137 seconds. Here is how the hpcopr run terraform/tofu. I used -parallelism=1000 to guarantee the concurrency. |
@zhenrong-wang Thank you very much for supporting us with additional details - we appreciate your contribution a lot! We will continue digging into the issue on our side tomorrow, and will keep you posted. Thanks! |
Hi @kislerdm Just tested 1.6.0-beta1 with the same version of alicloud provider. The problem seems to be still there. It cost 410 seconds to create the stack. |
Hi @zhenrong-wang, the proposed fix for this (#954) did not make it into beta1. Beta2 is coming really soon (hopefully within the next hour) which should resolve this issue for you. Thanks for your patience on this one. |
Thanks for your reply. Looking forward to the next beta version. |
This should be fixed @zhenrong-wang. I'll be closing this issue, but feel free to reopen if you hit any issues please. |
Thanks opentofu team! With beta2 version, the problem reported in this issue got resolved. Creating an HPC stack in Alicloud is as smooth as terraform now. Fantastic job! We are step closer to switch to openTofu. |
Hi opentofu developers,
I am switching my workload from terraform to opentofu. When I use 1.6.0-alpha5 and aliyun cloud provider 1.213.0, the provider is really slow to orchestrate the resources.
I opened the DEBUG mode, and it turns out the following message is streaming out continously. It usually takes ~100 seconds before the start of creating/destroying resources.
Is there anything wrong with the provider or openTofu ? Thanks a lot!
The text was updated successfully, but these errors were encountered: