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

Havoc when cloud maintainers discontinue image you are using. #40

Closed
cwant opened this issue Feb 6, 2020 · 4 comments
Closed

Havoc when cloud maintainers discontinue image you are using. #40

cwant opened this issue Feb 6, 2020 · 4 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation openstack
Milestone

Comments

@cwant
Copy link
Contributor

cwant commented Feb 6, 2020

Here's what happened to me, in the order it happened:

  1. I created a MC cluster two weeks ago using image CentOS-7-x64-2018-11;
  2. Since then, my cloud administrators disabled/deprecated CentOS-7-x64-2018-11 from the cloud;
  3. As a result, I can no longer terraform [plan|apply|destroy]

Not sure if this is an MC issue, or a terraform issue.

@cmd-ntrf cmd-ntrf added bug Something isn't working documentation Improvements or additions to documentation openstack question Further information is requested labels Feb 6, 2020
@cmd-ntrf cmd-ntrf self-assigned this Feb 6, 2020
@cmd-ntrf
Copy link
Member

cmd-ntrf commented Feb 10, 2020

Every time plan, apply or destroy is called, terraform refresh the deployment state. It makes multiple call to the cloud provider API to verify which resources exist, which don't, and refresh the data sources.

With OpenStack, the image UUID is fetch from the API using the image name provided in the main.tf. If the image no longer exists, the OpenStack API won't be able to find the UUID, and Terraform will stop there. There is no way around this for plan and apply, if the image no longer exists, these commands will not work until the image variable is updated. Updating the image variable will have for effect of rebuilding all instances, so at this point, you might want to create a new cluster from scratch instead.

When it comes to destroying, there is a known Terraform issue: hashicorp/terraform#15386. It is suggested that Terraform should ignore data input, like image UUID from image name.

That said, Terraform provides a flag to avoid refreshing the state, -refresh=false. This is a valid flag for destroy, so if the image no longer exist and you want to destroy everything, you could do:
terraform destroy -refresh=false. This would bypass all state refreshing and go straight to displaying the destroy plan.

Your observation raises two issues:

  1. We should document the -refresh=false false in MC documentation, at least in the destroy section.
  2. If the image variable is modified after the instances are created, it could be a good idea to tell Terraform to ignore the modifications, leaving the instance untouched even if the variable is modified.

@cmd-ntrf
Copy link
Member

cmd-ntrf commented Feb 11, 2020

40.1 - fixed in commit e0882bd.
See documentation section 9

@cmd-ntrf cmd-ntrf removed the question Further information is requested label Feb 11, 2020
@cmd-ntrf cmd-ntrf added this to the 5.8 milestone Feb 17, 2020
@cmd-ntrf
Copy link
Member

40.2 is fixed by commit 6b9cbc9.

@cwant
Copy link
Contributor Author

cwant commented Feb 17, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation openstack
Projects
None yet
Development

No branches or pull requests

2 participants