Skip to content
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

Performance issues during bundle exec kitchen destroy #434

Open
lmayorga1980 opened this issue Jan 19, 2021 · 10 comments
Open

Performance issues during bundle exec kitchen destroy #434

lmayorga1980 opened this issue Jan 19, 2021 · 10 comments

Comments

@lmayorga1980
Copy link

Terraform Version: 0.14.4
Kitchen-Terraform: Latest
Ruby: 2.6.6

It takes a long time to destroy resources using AWS as the provider(Longer than 30 minutes).

@aaron-lane
Copy link
Collaborator

Hello again @lmayorga1980!

What you described looks like an issue with AWS or the AWS provider as Kitchen-Terraform just shells out to run terraform destroy during the destroy action. Have you been able to run the same Terraform configuration without Kitchen-Terraform and verified that it does not take a long time to destroy?

@lmayorga1980
Copy link
Author

I thought of that before but terraform apply & terraform destroy are very fast but its the moment when I run bundle exec kitchen create or bundle exec kitchen destroy that takes long periods of time.

@aaron-lane
Copy link
Collaborator

Is it the actual Terraform run that's taking a long time, like resources are "still destroying..." for 30+ minutes, or is it a delay in running the Terraform commands? Do you have a repository which reproduces the issue that you can share?

@lmayorga1980
Copy link
Author

I am not sure if this is related to ruby or not but ruby 2.7.2 fixed my problem ...

Screen Shot 2021-01-19 at 12 50 32 PM

@lmayorga1980
Copy link
Author

I see the problem now.

Steps to Reproduce

  1. bundle exec kitchen converge - Creates infrastructure but fails in lets say the provisioning powershell script
  2. re-run bundle exec kitchen converge - This will destroy the failing resource and rebuild again.
  3. .kitchen/windowsapp.yml - It keeps the old IP Address from Add error handling for Terraform not being installed  #1.
  4. Try to run verify and fails because the old IP does not exist. and takes a long time
  5. bundle exec kitchen destroy experiments timeouts.

Fixed by manually editing the .kitchen/windowsapp.yml file and injecting the newer ip.

@aaron-lane
Copy link
Collaborator

Can you please clarify what IP address you're referring to in windowsapp.yml? Is it under the kitchen_terraform_outputs key?

@lmayorga1980
Copy link
Author

The windowsapp.yml contains the output results and is created under .kitchen/ directory.

@aaron-lane
Copy link
Collaborator

Sorry; what I meant was is this IP address a Terraform output? Those values should be updated each time kitchen converge is executed, so if that is not the case then this sounds like a bug in the output management.

@lmayorga1980
Copy link
Author

It seems that during the bundle kitchen destroy it was trying to connect to an old instance. When I cancel the long process with Ctrl+C then for some reason, several attempts to run bundle exec kitchen converge keep the old ip address.

@aaron-lane
Copy link
Collaborator

aaron-lane commented Jan 21, 2021

Are you able to isolate the point where the Terraform outputs are updated with a new IP address but windowsapp.yml still has the old IP address? I would like to understand how to reproduce this issue because the outputs within the Kitchen instance state file should always be updated with the latest Terraform outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants