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
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:
We should document the -refresh=false false in MC documentation, at least in the destroy section.
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.
Here's what happened to me, in the order it happened:
CentOS-7-x64-2018-11
;CentOS-7-x64-2018-11
from the cloud;terraform [plan|apply|destroy]
Not sure if this is an MC issue, or a terraform issue.
The text was updated successfully, but these errors were encountered: