-
Notifications
You must be signed in to change notification settings - Fork 68
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
Detach ISO on deletion #128
Comments
You can see this file for the behavior I'm talking about. https://github.com/johnrichardrinehart/infrastructure/blob/main/vultr.tf#L29 |
@johnrichardrinehart Thanks for taking the time to write up the ticket. I don't think any warnings/prompts may be necessary. To me it seems that the easiest approach to this would be to issue a detach if the current ISO has changed. Then watch the detach/iso status so we know once the ISO has fully detached and attach the new one. Also, really appreciate you taking the time to make these enhancements to the provider. |
Hey, not a problem - more thanks for taking the time to read it.
So, if a managed Note that the Vultr official HTTP(s) API (
Yeah, no problem! But, to be clear: You'd accept (and are requesting) a PR that implements behavior that allows for doing something like we're talking about, here? |
We had similar discussions about ISOs before #36. If I recall correctly this and a few other reasons are why we didn't expand functionality with ISOs. Now, that you created this ticket we are thinking about ISOs again and think that maybe the best solution here is what was laid out.
As for the warning you have a valid point that we could stdout something informative that the instances will be restarted due to the ISO being changed/removed.
Correct, I think there is a valid use case for what you are trying to achieve so it won't hurt to offer that type of functionality. |
Yeah, the API doesn't support something like "force detach", which makes it a bit awkward.
Fair enough. I'll get to work on this.
Alright, PR is forthcoming. |
Is the best place for this logic in govultr or in this repo? I'm thinking of implementing this "detach ISO then delete ISO" behavior in |
I am leaning towards keeping this in the terraform repo. We want to keep govultr as 1-1 as possible with the API.
This isn't something we can add which is why we have the I think the best path here is to have TF issue a detach and then watch the ISO state if the ISO has been removed or changed in the .TF file similar to
|
Fair enough.
Okay, I see.
Oh, awesome. I was implementing refresh-checking manually. This is much better. Thanks for pointing me to this. |
Closed with merge of #131. |
Describe the bug
Admittedly, I'm filing this as a bug when it might be considered a feature request.
I have a custom ISO that I use to start new VMs. Sometimes, I replace this ISO and want the associated machines re-started using the new ISO. This isn't possible with the current terraform provider because the ISO is still attached to a running machine. So, I have to either:
terraform apply
with the new ISO resource without issue.It seems to me that a warning should be shown at
terraform plan
/terraform apply
time, but that it should be possible to force apply the changes without resorting to touching the web interface.To Reproduce
Steps to reproduce the behavior:
terraform apply
to force the ISO resource and VM instance resource to use the latest ISO resource.Expected behavior
terraform apply
on attached ISO resources should raise a warning and/or a prompt for the user to force detach the ISO from running instances in order to continue applying the infrastructure changes.Screenshots
Desktop (please complete the following information where applicable:
Additional context
Please note that I have the
terraform-provider-vultr
repository forked and am prepared to issue a PR if it will be accepted.The text was updated successfully, but these errors were encountered: